Name |
Usage |
-help |
Display the help message |
-version |
Display the build number of the compiler. This is very useful to report a bug. |
-classpath <dir 1>;<dir 2>;...;<dir P> |
This is a list of directory or jar files used to compile the source files. There is no default classpath. So this option
is always required to compile source files. |
-d <dir 1>|none |
This is used to specify in which directory the generated .class files should be dumped. If it is omitted, no package directory structure is created.
If you don't want to generate .class files, use -d none. |
-target 1.1|1.2 |
This specifies the classfile target setting. The possible value are 1.1 or 1.2, default is 1.1 |
-1.3 |
Set compliance level to 1.3 (default) |
-1.4 |
Set compliance level to 1.4. |
-source 1.3|1.4 |
This is used to enable the assertion support of the compiler. The possible value are: 1.3 or 1.4, default is 1.3 in -1.3 mode and 1.4 in -1.4 mode.
In 1.4, assert is treated as a keyword. |
-warn: constructorName |packageDefaultMethod |deprecation |maskedCatchBlocks |unusedLocals |unusedArguments |unusedImports |syntheticAccess |assertIdentifier
|
Set warning level. e.g. -warn:unusedLocals,deprecation
constructorName |
warn method with constructor name |
packageDefaultMethod |
warn attempt to override package-default method |
deprecation |
warn usage of deprecated type or member |
maskedCatchBlocks |
warn hidden catch block |
unusedLocals |
warn unused local variable |
unusedArguments |
warn unused method argument |
unusedImports |
When enabled, the compiler will issue an error or a warning for unused import reference
|
syntheticAccess |
warn when performing synthetic access for innerclass |
assertIdentifier |
warn occurrence of assert used as identifier |
|
-nowarn |
No warning (equivalent to -warn:none) |
-deprecation |
Equivalent to -warn:deprecation. |
-g[:none|:lines,vars,source]
|
Set the debug attributes level
-g |
All debug info (equivalent to -g:lines,vars,source)
|
-g:none |
No debug info |
-g:[lines,vars,source] |
Selective debug info |
|
-preserveAllLocals |
Explicitly request the compiler to preserve all local variables (for debug purpose). If omitted, the compiler will removed unused locals. |
-noImportError |
The compiler won't report an error for unresolved imports. A warning is issued instead. |
-encoding <encoding name> |
Specify default source encoding format (custom encoding can also be specifed on a per file basis by suffixing each input source file/folder name with [encoding <encoding name>]). |
-log <filename> |
Specify a log file in which all output from the compiler will be dumped. This is really useful if you want to debug the batch
compiler or get a file which contains all errors and warnings from a batch build. |
-proceedOnError |
Keep compiling when error, dumping class files with problem methods or problem types. This is recommanded only if you want
to be able to run your application even if you have remaining errors. |
-verbose |
Print accessed/processed compilation units in the console or the log file if specified. |
-referenceInfo |
Compute reference info. This is useful only if connected to the builder. The reference infos are useless otherwise. |
-progress |
Show progress (only in -log mode) |
-time
|
Display speed information |
-noExit |
Do not call System.exit(n) at end of compilation (n=0 if no error) |
-repeat <n>
|
Repeat compilation process <n> times (perf analysis). |