Section B.2 The Java Interpreter:
javainterpreter launches a Java application. This command takes one of the following forms:
java[ options ] classname [ argument … ]
java[ options ] -jar file.jar [ argument … ]
If the first form is used,
javastarts a Java runtime environment. It then loads the specified classname and runs that class’s
main()method, which must be declared as follows:
public static void main(String args)
argsis an array of strings, which is used to pass any arguments listed on the command line. Command-line arguments are optional.
If the second form of the
javacommand is used,
javawill load the classes and resources from the specified Java archive (JAR). In this case, the special
-jaroption flag must be specified. The options can also include many other command-line options, including the
You have attempted of activities on this page.