Skip to content
Snippets Groups Projects
  • Nadav Har'El's avatar
    01cb7973
    CLI: Add "java" command · 01cb7973
    Nadav Har'El authored
    Add a "java" command to the CLI, using the same syntax of java.so and
    attempting to emulate as closely as possible the "java" command on Linux.
    So for example one can run
    
            java Hello
    
    to run /java/Hello.class (/java is on the classpath by default), or
    
            java -jar /java/bench.jar
    
    to run the main class of this jar, or a more sophisticated
    command lines, such as the following which runs Jetty (if the
    appropriate files are in your image):
    
            java -classpath /jetty/* org.eclipse.jetty.xml.XmlConfiguration /jetty/jetty.xml
    
    Note that like java.so, the new "java" command basically runs the RunJava
    class (/java/RunJava.class). Remember that java.so adds /java to the parent
    class loader, so we can always find the RunJava class even though it's not
    in cli.jar or cloudius.jar).
    01cb7973
    History
    CLI: Add "java" command
    Nadav Har'El authored
    Add a "java" command to the CLI, using the same syntax of java.so and
    attempting to emulate as closely as possible the "java" command on Linux.
    So for example one can run
    
            java Hello
    
    to run /java/Hello.class (/java is on the classpath by default), or
    
            java -jar /java/bench.jar
    
    to run the main class of this jar, or a more sophisticated
    command lines, such as the following which runs Jetty (if the
    appropriate files are in your image):
    
            java -classpath /jetty/* org.eclipse.jetty.xml.XmlConfiguration /jetty/jetty.xml
    
    Note that like java.so, the new "java" command basically runs the RunJava
    class (/java/RunJava.class). Remember that java.so adds /java to the parent
    class loader, so we can always find the RunJava class even though it's not
    in cli.jar or cloudius.jar).