Java Reference
In-Depth Information
The class invoked must be findable on either the bootstrap or user-
specified classpath.
5.4.2
Just as the Java compiler, the runtime program, java , takes a number of com-
mand-line options. Here are the most commonly used ones:
java Options
-classpath or -cp
Sets the runtime classpath. Overrides any value in the CLASSPATH
environment variable.
-Dproperty=value
Allows a system property to be set on the command line.
-jar
Specifies that the first nonoption command-line argument is not a Java
class name, but the name of a JAR file. The JAR file must have a
Main-Class: specification in its MANIFEST (see Section 5.11). The
main() method of the class named by the JAR's MANIFEST Main-Class:
specification will be called as if that class had been named on the command
line, rather than the JAR file. This is commonly used in shell scripts and
batch files that accompany Java applications distributed in single
.jar files.
There are several other command-line options that are less commonly
used. We will cover some of them in later chapters when their use will make
more sense. Of course, full documentation on all options for this command is
in the Sun Java SDK Development Tools documentation.
5.5
C OMPLETE , U P - TO -D ATE P ROGRAM D OCUMENTATION M ADE E ASY
One of Java's most useful features is javadoc , a command that (by default)
produces comprehensive HTML program documentation directly from the
program source. Since it works from the source, it can be automated, and you
may be certain that the documentation is up-to-date. It takes much of the
documentation burden off of programmers and permits new programmers to
join a project and rapidly come up to speed because there is comprehensive
documentation in a standard format. The javadoc tool produces HTML
Search WWH ::




Custom Search