Name

javac

Synopsis

    javac [options]files

Compile Java source code into Java bytecode, for execution with java. Java source files must have a .java suffix and must be named for the class whose code they contain. The generated bytecode files have a .class suffix. By default, class files are created in the same directory as the corresponding source files. Use the CLASSPATH variable to list directories and/or ZIP files that javac will search to find your classes.

In the case that there are too many files to list on the command line, you may list the source and class files in a separate file, and indicate the contents of the file to javac by prepending an @ to the filename.

Options

-bootclasspath path

Use the colon-separated list of directories in path for the boot classes, instead of the boot classes used by the java command itself.

-classpath path

Use the colon-separated list of directories in path instead of $CLASSPATH to find class files. It is usually a good idea to have the current directory (“.”) on the search path.

-cldc1.0

For compiling CLDC programs. This causes the compiler to generate stack maps, which obviates the need for the preverifier.

-d dir

Specify where to create generated class files.

-deprecation

Warn about every use or override of a deprecated member or class, instead of warning at the end.

-Djava.ext.dirs= dirs

Use dirs as the location for installed extensions.

-Djava.endorsed.dirs= dirs

Use dirs as the endorsed standards path.

-encoding encoding

The source file is ...

Get Unix in a Nutshell, 4th 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.