| Name |
Usage |
| Classpath options |
| -bootclasspath <dir 1>;<dir 2>;...;<dir P> |
This is a list of directory or jar files used to bootstrap the class files used by the compiler. By default the libraries of the running
VM are used. Entries are separated by the platform path separator. |
| -cp -classpath <dir 1>;<dir 2>;...;<dir P> |
This is a list of directory or jar files used to compile the source files. The default value is the value of the property "java.class.path".
Entries are separated by the platform path separator.
|
| -extdirs <dir 1>;<dir 2>;...;<dir P> |
This is a list of directory used to specify the location of extension zip/jar files. Entries are separated by the platform path separator. |
| -sourcepath <dir 1>;<dir 2>;...;<dir P> |
This is a list of directory used to specify the source files. Entries are separated by the platform path separator. |
| -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. |
| -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>]). |
| Compliance options |
| -target 1.1|1.2|1.3|1.4|1.5|5|5.0 |
This specifies the classfile target setting.
The possible value are:
- 1.1 (major version: 45 minor: 3)
- 1.2 (major version: 46 minor: 0)
- 1.3 (major version: 47 minor: 0)
- 1.4 (major version: 48 minor: 0)
- 1.5, 5 or 5.0 (major version: 49 minor: 0)
Defaults are:
- 1.1 in -1.3 mode
- 1.2 in -1.4 mode
- 1.5 in -1.5 mode
|
| -1.3 |
Set compliance level to 1.3. Implicit -source 1.3 -target 1.1. |
| -1.4 |
Set compliance level to 1.4 (default). Implicit -source 1.3 -target 1.2. |
| -1.5 |
Set compliance level to 1.5. Implicit -source 1.5 -target 1.5. |
| -source 1.3|1.4|1.5|5|5.0 |
This is used to enable the source level of the compiler.
The possible value are:
Defaults are:
- 1.3 in -1.3 mode
- 1.4 in -1.4 mode
- 1.5 in -1.5 mode
In 1.4, assert is treated as a keyword. In 1.5, enum and assert are treated as a keyword. |
| Warning options |
-warn:allDeprecation allJavadoc assertIdentifier boxing charConcat conditionAssign constructorName
dep-ann deprecation emptyBlock enumSwitch fieldHiding finalBound finally hiding incomplete-switch indirectStatic
intfAnnotation intfNonInherited javadoc localHiding
maskedCatchBlocks nls noEffectAssign null over-ann pkgDefaultMethod semicolon serial
specialParamHiding static-access staticReceiver suppress synthetic-access syntheticAccess tasks(<task1>|...|<taskN>)
typeHiding unchecked unnecessaryElse unqualified-field-access unqualifiedField uselessTypeCheck
unused unusedArgument unusedImport unusedLocal unusedPrivate unusedThrown
varargsCast warningToken
|
Set warning level. e.g. -warn:unusedLocals,deprecation
In red are the default settings.
-warn:<warnings separated by ,> enable exactly the listed warnings
-warn:+<warnings separated by ,> enable additional warnings
-warn:-<warnings separated by ,> disable specific warnings
| allDeprecation |
deprecation even inside deprecated code |
| allJavadoc |
invalid or missing javadoc |
| assertIdentifier |
occurrence of assert used as identifier |
| boxing |
autoboxing conversion |
| charConcat |
when a char array is used in a string concatenation without being converted explicitely to
a string |
| conditionAssign |
possible accidental boolean assignment |
| constructorName |
method with constructor name |
| dep-ann |
missing @Deprecated annotation |
| deprecation |
usage of deprecated type or member outside deprecated code |
| emptyBlock |
undocumented empty block |
enumSwitch, incomplete-switch |
incomplete enum switch |
| fieldHiding |
field hiding another variable |
| finalBound |
type parameter with final bound |
| finally |
finally block not completing normally |
| hiding |
macro for fieldHiding, localHiding, typeHiding and maskedCatchBlock |
| indirectStatic |
indirect reference to static member |
| intfAnnotation |
annotation type used as super interface |
| intfNonInherited |
interface non-inherited method compatibility |
| javadoc |
invalid javadoc |
| localHiding |
local variable hiding another variable |
| maskedCatchBlocks |
hidden catch block |
| nls |
non-nls string literals (lacking of tags //$NON-NLS-<n>) |
| noEffectAssign |
for assignment with no effect |
| null |
missing or redundant null check |
| over-ann |
missing @Override annotation |
| pkgDefaultMethod |
attempt to override package-default method |
| serial |
missing serialVersionUID |
| semicolon |
unnecessary semicolon or empty statement |
| specialParamHiding |
constructor or setter parameter hiding another field |
| static-access |
macro for indirectStatic and staticReceiver |
| staticReceiver |
if a non static receiver is used to get a static field or call a static method |
| suppress |
enable @SuppressWarnings |
syntheticAccess, synthetic-access |
when performing synthetic access for innerclass |
| tasks |
enable support for tasks tags in source code |
| typeHiding |
type parameter hiding another type |
| unchecked |
unchecked type operation |
| unnecessaryElse |
unnecessary else clause |
unqualified-field-access, unqualifiedField |
unqualified reference to field |
| unused |
macro for unusedArgument, unusedImport, unusedLocal, unusedPrivate and unusedThrown |
| unusedArgument |
unused method argument |
| unusedImport |
unused import reference |
| unusedLocal |
unused local variable |
| unusedPrivate |
unused private member declaration |
| unusedThrown |
unused declared thrown exception |
| uselessTypeCheck |
unnecessary cast/instanceof operation |
| varargsCast |
varargs argument need explicit cast |
| warningToken |
unhandled warning token in @SuppressWarningsb |
|
| -nowarn |
No warning (equivalent to -warn:none) |
| -deprecation |
Equivalent to -warn:deprecation. |
| Debug options |
| -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. |
| Advanced options |
| @<file> |
Read command-line arguments from file |
| -maxProblems <n> |
Max number of problems per compilation unit (100 by default) |
| -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. If the extension is .xml, the generated log
will be a xml file.
|
| -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). |
| -inlineJSR |
Inline JSR bytecode (implicit if target >= 1.5) |
| -enableJavadoc |
Consider references inside javadoc |
| Helping options |
| -? -help |
Display the help message |
| -v -version |
Display the build number of the compiler. This is very useful to report a bug. |
| -showversion |
Display the build number of the compiler and continue. This is very useful to report a bug. |