javac—The Java Compiler

The javac program is the tool you use to compile .java files into class files that can be run by the interpreter. The command is executed like this:

javac <options> <sourcefiles>

Table B.2 lists the Java compiler options.

Table B.2. Java Compiler Options
Option Description
-g Generates all debugging information.
-g:none Doesn't generate any debugging information.
-verbose Outputs messages that describe what the compiler is doing.
-deprecation Outputs source locations where deprecated API's are being used.
-classpath <path> Overrides the default CLASSPATH environment variable and specifies a new path to look up classes. Make certain you always include library classes, such as jdk1.2\ jre\ rt.jar.
-d <directory> Specifies ...

Get Special Edition Using Java 2 Standard Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.