blob: 4e8a11c492eb759bafa02639f7eb68b8964327ed [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta name="copyright" content=
"Copyright (c) IBM Corporation and others 2000, 2020. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<link rel="STYLESHEET" href="../book.css" charset="ISO-8859-1" type="text/css" />
<title>Using the batch compiler</title>
<link rel="stylesheet" type="text/css" href="../book.css" />
<style type="text/css">
/*<![CDATA[*/
td.c5 {background-color: #FFCCAA}
pre.c4 {color: #3366FF}
span.c3 {color: #3366FF}
/*]]>*/
</style>
</head>
<body>
<a name="t_batch_compiler"></a>
<h2>Using the batch compiler</h2>
<h3>Finding the batch compiler</h3>
<p>The batch compiler class is located in the JDT Core plug-in. The name of the class is <i>org.eclipse.jdt.compiler.batch.BatchCompiler</i>. It is packaged into
<code>plugins/org.eclipse.jdt.core_&lt;version&gt;.jar</code>. Since 3.2, it is also available as a separate download. The name of the file is <code>ecj.jar</code>. Its corresponding source
is also available. To get them, go to the <a href="http://download.eclipse.org/eclipse/downloads/">download page</a> and select the link for the desired build name. Search for the section <b>JDT Core Batch Compiler</b>. This jar contains the
batch compiler and the javac ant adapter.</p>
<p>Since 3.3, this jar also contains the support for jsr199 (Compiler API) and the support for jsr269 (Annotation processing). <b>In order to use the annotations processing support, a 1.6 VM is
required.</b></p>
<p>So it can be used as a standalone application and inside an Ant build outside of Eclipse.</p>
<h3>Running the batch compiler</h3>
<ul>
<li>From the command line.
<p><code><span class="c3">java -jar org.eclipse.jdt.core_&lt;version&gt;.jar -classpath rt.jar A.java</span></code></p>
<p>or:</p>
<p><code><span class="c3">java -jar ecj.jar -classpath rt.jar A.java</span></code></p>
</li>
<li>Using the static <code>compile(String commandLine, PrintWriter outWriter, PrintWriter errWriter, CompilationProgress progress)</code> method of the class BatchCompiler.
<pre class="c4">
org.eclipse.jdt.core.compiler.CompilationProgress progress = null; // instantiate your subclass
org.eclipse.jdt.core.compiler.batch.BatchCompiler.compile(
"-classpath rt.jar A.java",
new PrintWriter(System.out),
new PrintWriter(System.err),
progress);
</pre>
<p>You can control how progress is reported, or how the batch compiler is canceled, by subclassing the class <i>org.eclipse.jdt.compiler.CompilationProgress</i>.</p>
</li>
</ul>
<h4>Which options are available?</h4>
<p>The recommended options have an orange background.</p>
<p>When some options are being set multiple times, the batch compiler consumes them from left to right. When the warning option (-warn:....) is used without '+' or '-', this overrides the set of
warnings previously specified. So you should make sure that such an option is given before any other usage of the -warn option.</p>
<p>Same applies for the -err: and -info: options.</p>
<table border="1" cellspacing="2" cellpadding="2">
<tr>
<th>Name</th>
<th colspan="3">Usage</th>
</tr>
<tr>
<th colspan="4">Classpath options</th>
</tr>
<tr>
<td class="c5" valign="top" width="250" id="bootclasspath">-bootclasspath &lt;dir&nbsp;1&gt;;&lt;dir&nbsp;2&gt;;...;&lt;dir&nbsp;P&gt;</td>
<td class="c5" valign="top" colspan="3">This is a list of directories 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.<br />
Each directory or file can specify access rules for types between '[' and ']'.
<p>If no bootclasspath is specified, the compiler will infer it using the following system properties <code>sun.boot.class.path</code>, <code>vm.boot.class.path</code> or
<code>org.apache.harmony.boot.class.path</code> in this order respectively.</p>
<p>This option is not supported when compliance is 9 over later.</p>
</td>
</tr>
<tr>
<td class="c5" valign="top" width="250" id="cp">-cp<br />
-classpath &lt;dir&nbsp;1&gt;;&lt;dir&nbsp;2&gt;;...;&lt;dir&nbsp;P&gt;</td>
<td class="c5" valign="top" colspan="3">This is a list of directories 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.<br />
Each directory or file can specify access rules for types between '[' and ']' (e.g. [-X] to forbid access to type X, [~X] to discourage access to type X, [+p/X:-p/*] to forbid access to all types in
package p but allow access to p/X).<br />
The compiler follows the <code>Class-Path</code> clauses of jar files' manifests recursively and appends each referenced jar file to the end of the classpath, provided it is not on the classpath
yet.</td>
</tr>
<tr>
<td valign="top" width="250" id="extdirs">-extdirs &lt;dir&nbsp;1&gt;;&lt;dir&nbsp;2&gt;;...;&lt;dir&nbsp;P&gt;</td>
<td valign="top" colspan="3">This is a list of directories used to specify the location of extension zip/jar files.
Entries are separated by the platform path separator. This option is not supported when compliance is 9 over later.</td>
</tr>
<tr>
<td valign="top" width="250" id="endorseddirs">-endorseddirs &lt;dir&nbsp;1&gt;;&lt;dir&nbsp;2&gt;;...;&lt;dir&nbsp;P&gt;</td>
<td valign="top" colspan="3">This is a list of directories used to specify the location of endorsed zip/jar files.
Entries are separated by the platform path separator. This option is not supported when compliance is 9 over later.</td>
</tr>
<tr>
<td valign="top" width="250" id="sourcepath">-sourcepath &lt;dir&nbsp;1&gt;;&lt;dir&nbsp;2&gt;;...;&lt;dir&nbsp;P&gt;</td>
<td valign="top" colspan="3">This is a list of directories used to specify the source files. Entries are separated by the platform path separator.<br />
Each directory can specify access rules for types between '[' and ']'.</td>
</tr>
<tr>
<td valign="top" width="250" id="modulepath">--module-path &lt;dir&nbsp;1&gt;;&lt;dir&nbsp;2&gt;;...;&lt;dir&nbsp;P&gt;</td>
<td valign="top" colspan="3">This is a list of directories used to specify module locations. Entries are separated by the platform path separator.<br />
Each directory can specify access rules for types between '[' and ']'.</td>
</tr>
<tr>
<td valign="top" width="250" id="modulesourcepath">--module-source-path &lt;dir&nbsp;1&gt;;&lt;dir&nbsp;2&gt;;...;&lt;dir&nbsp;P&gt;</td>
<td valign="top" colspan="3">This is a list of directories used to specify the source modules that need to be compiler. Entries are separated by the platform path separator.<br />
Each directory can specify access rules for types between '[' and ']'.</td>
</tr>
<tr>
<td valign="top" width="250" id="processormodulepath">--processor-module-path &lt;dir&nbsp;1&gt;;&lt;dir&nbsp;2&gt;;...;&lt;dir&nbsp;P&gt;</td>
<td valign="top" colspan="3">This is a list of directories used to specify the module oriented annotation processors. Entries are separated by the platform path separator.<br />
Each directory can specify access rules for types between '[' and ']'.</td>
</tr>
<tr>
<td valign="top" width="250" id="system">--system</td>
<td valign="top" colspan="3">This is a directory pointing to the system modules.</td>
</tr>
<tr>
<td valign="top" width="250" id="addexports">--add-exports &lt;module&gt;/&lt;package&gt;=&lt;other-module&gt;(,&lt;other-module&gt;)*</td>
<td valign="top" colspan="3">Specifies a package to be considered as exported from its defining module to additional modules.</td>
</tr>
<tr>
<td valign="top" width="250" id="addreads">--add-reads &lt;module&gt;=&lt;other-module&gt;(,&lt;other-module&gt;)*</td>
<td valign="top" colspan="3">Specifies additional modules to be considered as required by a given module.</td>
</tr>
<tr>
<td valign="top" width="250" id="addmodules">--add-modules &lt;module&gt;(,&lt;module&gt;)*</td>
<td valign="top" colspan="3">Specifies root modules to resolve in addition to the initial modules, or all modules.</td>
</tr>
<tr>
<td valign="top" width="250" id="limitmodules">--limit-modules &lt;module&gt;(,&lt;module&gt;)*</td>
<td valign="top" colspan="3">Limits the observable modules to the list of specified modules.</td>
</tr>
<tr>
<td class="c5" valign="top" width="250" id="d">-d &lt;dir 1&gt;|none</td>
<td class="c5" colspan="3">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.<br />
If you want to generate no .class file at all, use <span class="c3">-d none</span>.</td>
</tr>
<tr>
<td valign="top" width="250" id="encoding">-encoding &lt;encoding name&gt;</td>
<td colspan="3">Specify default encoding for all source files. Custom encoding can also be specified on a per file basis by suffixing each input source file/folder name with <span class=
"c3">[&lt;encoding name&gt;]</span>. For example <span class="c3">X.java[UTF-8]</span> would specify the <code>UTF-8</code> encoding for the compilation unit X.java located in the current user
directory.
<p>If multiple default source file encodings are specified, the last one will be used.</p>
<p>For example:</p>
<ul>
<li><span class="c3"><code>... -encoding UTF-8 X.java[Cp1252] Y.java[UTF-16] Z.java ....</code></span><br />
Most source files will be read using UTF-8 encoding (this includes <span class="c3">Z.java</span>). <span class="c3">X.java</span> will be read using Cp1252 encoding and <span class="c3">Y.java</span>
will be read using UTF-16 encoding.</li>
<li><span class="c3"><code>... -encoding UTF-8 -encoding UTF-16 ....</code></span><br />
All source files will be read using UTF-16 encoding. The -encoding option for UTF-8 is ignored.</li>
<li><span class="c3"><code>... -encoding Cp1252 /foo/bar/X.java[UTF-16] /foo/bar[UTF-8] ....</code></span><br />
All source files will be read using Cp1252 encoding. X.java is the only file inside the /foo/bar directory to be read using the encoding UTF-16. All other files in that directory will use UTF-8
encoding.</li>
</ul>
</td>
</tr>
<tr>
<th colspan="4">Compliance options</th>
</tr>
<tr>
<td valign="top" width="250" id="preview">--enable-preview </td>
<td colspan="3">This specifies whether the compiler should allow
preview Java language features. It is important to note that only
the preview features from the latest supported Java release, i.e. Java 15
are supported by the compiler.
</td>
</tr>
<tr>
<td valign="top" width="250" id="release">--release 6, 7, 8, 9, 10, 11, 12, 13, 14 and 15 </td>
<td colspan="3">This specifies the VM version that source files should be compiled for.
The support for the specific releases comes from the JVM used. Hence, it is advised to
check the JVM's documentation for the supported values.
<ul>
<li><span class="c3">6</span> (major version: 50 minor: 0)</li>
<li><span class="c3">7</span> (major version: 51 minor: 0)</li>
<li><span class="c3">8</span> (major version: 52 minor: 0)</li>
<li><span class="c3">9</span> (major version: 53 minor: 0)</li>
<li><span class="c3">10</span> (major version: 54 minor: 0)</li>
<li><span class="c3">11</span> (major version: 55 minor: 0)</li>
<li><span class="c3">12</span> (major version: 56 minor: 0)</li>
<li><span class="c3">13</span> (major version: 57 minor: 0)</li>
<li><span class="c3">14</span> (major version: 58 minor: 0)</li>
<li><span class="c3">15</span> (major version: 59 minor: 0)</li>
</ul>
Passing <span class="c3">--release 8</span> to the compiler implicitly sets
<span class="c3">-source 1.8</span> and <span class="c3">-target 1.8</span>.
However, using <span class="c3">-source</span>, <span class="c3">-target</span> or
<span class="c3">1.7, 1.8</span> etc. together with <span class="c3">--release</span> is
disallowed.
</td>
</tr>
<tr>
<td valign="top" width="250" id="target">-target 1.1 to 15 (or 8, 8.0, etc.)</td>
<td colspan="3">This specifies the .class file target setting. The possible value are:
<ul>
<li><span class="c3">1.1</span> (major version: 45 minor: 3)</li>
<li><span class="c3">1.2</span> (major version: 46 minor: 0)</li>
<li><span class="c3">1.3</span> (major version: 47 minor: 0)</li>
<li><span class="c3">1.4</span> (major version: 48 minor: 0)</li>
<li><span class="c3">1.5</span>, <span class="c3">5</span> or <span class="c3">5.0</span> (major version: 49 minor: 0)</li>
<li><span class="c3">1.6</span>, <span class="c3">6</span> or <span class="c3">6.0</span> (major version: 50 minor: 0)</li>
<li><span class="c3">1.7</span>, <span class="c3">7</span> or <span class="c3">7.0</span> (major version: 51 minor: 0)</li>
<li><span class="c3">1.8</span>, <span class="c3">8</span> or <span class="c3">8.0</span> (major version: 52 minor: 0)</li>
<li><span class="c3">9</span> (major version: 53 minor: 0)</li>
<li><span class="c3">10</span> (major version: 54 minor: 0)</li>
<li><span class="c3">11</span> (major version: 55 minor: 0)</li>
<li><span class="c3">12</span> (major version: 56 minor: 0)</li>
<li><span class="c3">13</span> (major version: 57 minor: 0)</li>
<li><span class="c3">14</span> (major version: 58 minor: 0)</li>
<li><span class="c3">15</span> (major version: 59 minor: 0)</li>
</ul>
Defaults are:
<ul>
<li><span class="c3">1.1</span> in <span class="c3">-1.3</span> mode</li>
<li><span class="c3">1.2</span> in <span class="c3">-1.4</span> mode</li>
<li><span class="c3">1.5</span> in <span class="c3">-1.5</span> mode</li>
<li><span class="c3">1.6</span> in <span class="c3">-1.6</span> mode</li>
<li><span class="c3">1.7</span> in <span class="c3">-1.7</span> mode</li>
<li><span class="c3">1.8</span> in <span class="c3">-1.8</span> mode</li>
<li><span class="c3">9</span> in <span class="c3">-9</span> mode</li>
<li><span class="c3">10</span> in <span class="c3">-10</span> mode</li>
<li><span class="c3">11</span> in <span class="c3">-11</span> mode</li>
<li><span class="c3">12</span> in <span class="c3">-12</span> mode</li>
<li><span class="c3">13</span> in <span class="c3">-13</span> mode</li>
<li><span class="c3">14</span> in <span class="c3">-14</span> mode</li>
<li><span class="c3">15</span> in <span class="c3">-15</span> mode</li>
</ul>
<p>clcd1.1 can be used to generate the StackMap attribute.</p>
</td>
</tr>
<tr>
<td valign="top" id="_1.3">-1.3</td>
<td colspan="3">Set compliance level to <span class="c3">1.3</span>. Implicit -source 1.3 -target 1.1.</td>
</tr>
<tr>
<td valign="top" id="_1.4">-1.4</td>
<td colspan="3">Set compliance level to <span class="c3">1.4</span> (default). Implicit -source 1.3 -target 1.2.</td>
</tr>
<tr>
<td valign="top" id="_1.5">-1.5</td>
<td colspan="3">Set compliance level to <span class="c3">1.5</span>. Implicit -source 1.5 -target 1.5.</td>
</tr>
<tr>
<td valign="top" id="_1.6">-1.6</td>
<td colspan="3">Set compliance level to <span class="c3">1.6</span>. Implicit -source 1.6 -target 1.6.</td>
</tr>
<tr>
<td valign="top" id="_1.7">-1.7</td>
<td colspan="3">Set compliance level to <span class="c3">1.7</span>. Implicit -source 1.7 -target 1.7.</td>
</tr>
<tr>
<td valign="top" id="_1.8">-1.8</td>
<td colspan="3">Set compliance level to <span class="c3">1.8</span>. Implicit -source 1.8 -target 1.8.</td>
</tr>
<tr>
<td valign="top" id="_9">-9</td>
<td colspan="3">Set compliance level to <span class="c3">9</span>. Implicit -source 9 -target 9.</td>
</tr>
<tr>
<td valign="top" id="_10">-10</td>
<td colspan="3">Set compliance level to <span class="c3">10</span>. Implicit -source 10 -target 10.</td>
</tr>
<tr>
<td valign="top" id="_11">-11</td>
<td colspan="3">Set compliance level to <span class="c3">11</span>. Implicit -source 11 -target 11.</td>
</tr>
<tr>
<td valign="top" id="_12">-12</td>
<td colspan="3">Set compliance level to <span class="c3">12</span>. Implicit -source 12 -target 12.</td>
</tr>
<tr>
<td valign="top" id="_13">-13</td>
<td colspan="3">Set compliance level to <span class="c3">13</span>. Implicit -source 13 -target 13.</td>
</tr>
<tr>
<td valign="top" id="_14">-14</td>
<td colspan="3">Set compliance level to <span class="c3">14</span>. Implicit -source 14 -target 14.</td>
</tr>
<tr>
<td valign="top" id="_15">-15</td>
<td colspan="3">Set compliance level to <span class="c3">15</span>. Implicit -source 15 -target 15.</td>
</tr>
<tr>
<td valign="top" width="250" id="source">-source 1.1 to 15 (or 8, 8.0, etc.)</td>
<td colspan="3">This is used to specify the source level expected by the compiler.<br />
The possible value are:
<ul>
<li><span class="c3">1.3</span></li>
<li><span class="c3">1.4</span></li>
<li><span class="c3">1.5</span>, <span class="c3">5</span> or <span class="c3">5.0</span></li>
<li><span class="c3">1.6</span>, <span class="c3">6</span> or <span class="c3">6.0</span></li>
<li><span class="c3">1.7</span>, <span class="c3">7</span> or <span class="c3">7.0</span></li>
<li><span class="c3">1.8</span>, <span class="c3">8</span> or <span class="c3">8.0</span></li>
<li><span class="c3">9</span></li>
<li><span class="c3">10</span></li>
<li><span class="c3">11</span></li>
<li><span class="c3">12</span></li>
<li><span class="c3">13</span></li>
<li><span class="c3">14</span></li>
<li><span class="c3">15</span></li>
</ul>
Defaults are:
<ul>
<li><span class="c3">1.3</span> in <span class="c3">-1.3</span> mode</li>
<li><span class="c3">1.3</span> in <span class="c3">-1.4</span> mode</li>
<li><span class="c3">1.5</span> in <span class="c3">-1.5</span> mode</li>
<li><span class="c3">1.6</span> in <span class="c3">-1.6</span> mode</li>
<li><span class="c3">1.7</span> in <span class="c3">-1.7</span> mode</li>
<li><span class="c3">1.8</span> in <span class="c3">-1.8</span> mode</li>
<li><span class="c3">9</span> in <span class="c3">-9</span> mode</li>
<li><span class="c3">10</span> in <span class="c3">-10</span> mode</li>
<li><span class="c3">11</span> in <span class="c3">-11</span> mode</li>
<li><span class="c3">12</span> in <span class="c3">-12</span> mode</li>
<li><span class="c3">13</span> in <span class="c3">-13</span> mode</li>
<li><span class="c3">14</span> in <span class="c3">-14</span> mode</li>
<li><span class="c3">15</span> in <span class="c3">-15</span> mode</li>
</ul>
In <span class="c3">1.4</span>, <span class="c3"><i>assert</i></span> is treated as a keyword. In <span class="c3">1.5</span> and <span class="c3">1.6</span>, <span class="c3"><i>enum</i></span> and
<span class="c3"><i>assert</i></span> are treated as keywords.</td>
</tr>
<tr>
<th colspan="4">Warning options</th>
</tr>
<tr>
<td valign="top">-?:warn -help:warn</td>
<td colspan="3">Display advanced warning options</td>
</tr>
<tr>
<td valign="top" width="250" rowspan="101"><a id="warn">-warn:...</a></td>
<!-- !!! YOU MUST ADJUST THE rowspan IF YOU ADD/REMOVE A -warn SUB-OPTION !!! -->
<td valign="top" colspan="3">Specify the set of enabled warnings.<br />
<table>
<tr>
<td><span class="c3">-warn:none</span></td>
<td>disable all warnings and infos</td>
</tr>
<tr>
<td><span class="c3">-warn:</span>&lt;warning tokens separated by <span class="c3">,</span>&gt;</td>
<td>enable exactly the listed warnings</td>
</tr>
<tr>
<td><span class="c3">-warn:+</span>&lt;warning tokens separated by <span class="c3">,</span>&gt;</td>
<td>enable additional warnings</td>
</tr>
<tr>
<td><span class="c3">-warn:-</span>&lt;warning tokens separated by <span class="c3">,</span>&gt;</td>
<td>disable specific warnings</td>
</tr>
</table>
<p>Examples:</p>
<ul>
<li><span class="c3">-warn:unusedLocal,deprecation</span> enables only the given two warning options and disables all the other options</li>
<li><span class="c3">-warn:-unusedLocal,deprecation,+fallthrough</span> disables <span class="c3">unusedLocal</span> and <span class="c3">deprecation</span>,
enables <span class="c3">fallthrough</span>, and leaves the other warning options untouched</li>
</ul>
In the column <strong>Default</strong> below, a mark "+/-" indicates that an option covers several fine grained warning variants,
some of which are enabled by default, others disabled. This means that specifying the given option with "+"
will enable more warnings than the default, and specifying "-" disables some that are enabled by default.
</td>
</tr>
<tr>
<th align="center" width="50">Default</th>
<th align="left" width="150">Token name</th>
<th align="left">Description</th>
</tr>
<tr>
<td align="center" valign="top">+/-</td>
<td align="left" valign="top">allDeadCode</td>
<td valign="top">dead code including trivial if (DEBUG) check</td>
</tr>
<tr>
<td align="center" valign="top">+/-</td>
<td align="left" valign="top">allDeprecation</td>
<td valign="top">deprecation even inside deprecated code</td>
</tr>
<tr>
<td align="center" valign="top">-</td>
<td align="left" valign="top">allJavadoc</td>
<td valign="top">invalid or missing Javadoc</td>
</tr>
<tr>
<td align="center" valign="top">-</td>
<td align="left" valign="top">allOver-ann</td>
<td valign="top">all missing @Override annotations (superclass and superinterfaces)</td>
</tr>
<tr>
<td align="center" valign="top">-</td>
<td align="left" valign="top">all-static-method</td>
<td valign="top">all method can be declared as static warnings</td>
</tr>
<tr>
<td align="center" valign="top">+</td>
<td align="left" valign="top">assertIdentifier</td>
<td valign="top">occurrence of <i>assert</i> used as identifier</td>
</tr>
<tr>
<td align="center" valign="top">-</td>
<td align="left" valign="top">boxing</td>
<td valign="top">autoboxing conversion</td>
</tr>
<tr>
<td align="center" valign="top">+</td>
<td align="left" valign="top">charConcat</td>
<td valign="top">when a char array is used in a string concatenation without being converted explicitly to a string</td>
</tr>
<tr>
<td align="center" valign="top">+</td>
<td align="left" valign="top">compareIdentical</td>
<td valign="top">comparing identical expressions</td>
</tr>
<tr>
<td align="center" valign="top">-</td>
<td align="left" valign="top">conditionAssign</td>
<td valign="top">possible accidental boolean assignment</td>
</tr>
<tr>
<td align="center" valign="top">+</td>
<td align="left" valign="top">constructorName</td>
<td valign="top">method with constructor name</td>
</tr>
<tr>
<td align="center" valign="top">+</td>
<td align="left" valign="top">deadCode</td>
<td valign="top">dead code excluding trivial if (DEBUG) check</td>
</tr>
<tr>
<td align="center" valign="top">-</td>
<td align="left" valign="top">dep-ann</td>
<td valign="top">missing @Deprecated annotation</td>
</tr>
<tr>
<td align="center" valign="top">+/-</td>
<td align="left" valign="top">deprecation</td>
<td valign="top">usage of deprecated type or member outside deprecated code</td>
</tr>
<tr>
<td align="center" valign="top">+</td>
<td align="left" valign="top">discouraged</td>
<td valign="top">use of types matching a discouraged access rule</td>
</tr>
<tr>
<td align="center" valign="top">-</td>
<td align="left" valign="top">emptyBlock</td>
<td valign="top">undocumented empty block</td>
</tr>
<tr>
<td align="center" valign="top">+</td>
<td align="left" valign="top">enumIdentifier</td>
<td valign="top">occurrence of <i>enum</i> used as identifier</td>
</tr>
<tr>
<td align="center" valign="top">+</td>
<td align="left" valign="top">enumSwitch</td>
<td valign="top">incomplete enum switch</td>
</tr>
<tr>
<td align="center" valign="top">-</td>
<td align="left" valign="top">enumSwitchPedantic</td>
<td valign="top">report missing enum switch cases even in the presence of a default case</td>
</tr>
<tr>
<td align="center" valign="top">-</td>
<td align="left" valign="top">fallthrough</td>
<td valign="top">possible fall-through case</td>
</tr>
<tr>
<td align="center" valign="top">-</td>
<td align="left" valign="top">fieldHiding</td>
<td valign="top">field hiding another variable</td>
</tr>
<tr>
<td align="center" valign="top">+</td>
<td align="left" valign="top">finalBound</td>
<td valign="top">type parameter with final bound</td>
</tr>
<tr>
<td align="center" valign="top">+</td>
<td align="left" valign="top">finally</td>
<td valign="top">finally block not completing normally</td>
</tr>
<tr>
<td align="center" valign="top">+</td>
<td align="left" valign="top">forbidden</td>
<td valign="top">use of types matching a forbidden access rule</td>
</tr>
<tr>
<td align="center" valign="top">-</td>
<td align="left" valign="top">hashCode</td>
<td valign="top">missing hashCode() method when overriding equals()</td>
</tr>
<tr>
<td align="center" valign="top">+/-</td>
<td align="left" valign="top">hiding</td>
<td valign="top">macro for fieldHiding, localHiding, maskedCatchBlock, and typeHiding</td>
</tr>
<tr>
<td align="center" valign="top">-</td>
<td align="left" valign="top">includeAssertNull</td>
<td valign="top">raise null warnings for variables that got tainted in an assert expression</td>
</tr>
<tr>
<td align="center" valign="top">-</td>
<td align="left" valign="top">indirectStatic</td>
<td valign="top">indirect reference to static member</td>
</tr>
<tr>
<td align="center" valign="top">-</td>
<td align="left" valign="top">inheritNullAnnot</td>
<td valign="top">consider null annotations as being inherited from an overridden method to any overriding methods</td>
</tr>
<tr>
<td align="center" valign="top">+</td>
<td align="left" valign="top">intfAnnotation</td>
<td valign="top">annotation type used as super interface</td>
</tr>
<tr>
<td align="center" valign="top">+</td>
<td align="left" valign="top">intfNonInherited</td>
<td valign="top">interface non-inherited method compatibility</td>
</tr>
<tr>
<td align="center" valign="top">-</td>
<td align="left" valign="top">intfRedundant</td>
<td valign="top">find redundant superinterfaces</td>
</tr>
<tr>
<td align="center" valign="top">-</td>
<td align="left" valign="top">invalidJavadoc</td>
<td valign="top">macro to toggle the 'malformed Javadoc comments' option and all its sub-options listed below</td>
</tr>
<tr>
<td align="center" valign="top">-</td>
<td align="left" valign="top">invalidJavadocTag</td>
<td valign="top">report invalid Javadoc tags in Javadoc comments.</td>
</tr>
<tr>
<td align="center" valign="top">-</td>
<td align="left" valign="top">invalidJavadocTagDep</td>
<td valign="top">report invalid deprecated references in Javadoc tag arguments</td>
</tr>
<tr>
<td align="center" valign="top">-</td>
<td align="left" valign="top">invalidJavadocTagNotVisible</td>
<td valign="top">report invalid non-visible references in Javadoc tag arguments</td>
</tr>
<tr>
<td align="center" valign="top">-</td>
<td align="left" valign="top">invalidJavadocVisibility(&lt;visibility&gt;)</td>
<td valign="top">specify visibility modifier ("public", "protected" or "private") for malformed Javadoc tag warnings. Usage
example: invalidJavadocVisibility(public)</td>
</tr>
<tr>
<td align="center" valign="top">-</td>
<td align="left" valign="top">javadoc</td>
<td valign="top">invalid Javadoc</td>
</tr>
<tr>
<td align="center" valign="top">-</td>
<td align="left" valign="top">localHiding</td>
<td valign="top">local variable hiding another variable</td>
</tr>
<tr>
<td align="center" valign="top">+</td>
<td align="left" valign="top">maskedCatchBlock</td>
<td valign="top">hidden catch block</td>
</tr>
<tr>
<td align="center" valign="top">-</td>
<td align="left" valign="top">missingJavadocTags</td>
<td valign="top">macro to toggle the 'missing Javadoc tags' option and all its sub-options listed below</td>
</tr>
<tr>
<td align="center" valign="top">-</td>
<td align="left" valign="top">missingJavadocTagsMethod</td>
<td valign="top">report missing Javadoc tags for a method's type parameters</td>
</tr>
<tr>
<td align="center" valign="top">-</td>
<td align="left" valign="top">missingJavadocTagsOverriding</td>
<td valign="top">report missing Javadoc tags in overriding methods</td>
</tr>
<tr>
<td align="center" valign="top">-</td>
<td align="left" valign="top">missingJavadocTagsVisibility(&lt;visibility&gt;)</td>
<td valign="top">specify visibility modifier ("public", "protected" or "private") for missing Javadoc tags warnings. Usage
example: missingJavadocTagsVisibility(public)</td>
</tr>
<tr>
<td align="center" valign="top">-</td>
<td align="left" valign="top">missingJavadocComments</td>
<td valign="top">macro to toggle the 'missing Javadoc comments' option and all its sub-options listed below</td>
</tr>
<tr>
<td align="center" valign="top">-</td>
<td align="left" valign="top">missingJavadocCommentsOverriding</td>
<td valign="top">report missing Javadoc comments in overriding methods</td>
</tr>
<tr>
<td align="center" valign="top">-</td>
<td align="left" valign="top">missingJavadocCommentsVisibility(&lt;visibility&gt;)</td>
<td valign="top">specify visibility modifier ("public", "protected" or "private") for missing Javadoc comments warnings. Usage
example: missingJavadocCommentsVisibility(public)</td>
</tr>
<tr>
<td align="center" valign="top">-</td>
<td align="left" valign="top">nls</td>
<td valign="top">non-nls string literals (lacking of tags //$NON-NLS-&lt;n&gt;)</td>
</tr>
<tr>
<td align="center" valign="top">+</td>
<td align="left" valign="top">noEffectAssign</td>
<td valign="top">assignment with no effect</td>
</tr>
<tr>
<td align="center" valign="top">+</td>
<td align="left" valign="top">nonnullNotRepeated</td>
<td valign="top">nonnull parameter annotation from overridden method is not repeated in an overriding method. Is effective only with the nullAnnot option enabled.</td>
</tr>
<tr>
<td align="center" valign="top">+/-</td>
<td align="left" valign="top">null</td>
<td valign="top">potential missing or redundant null check</td>
</tr>
<tr>
<td align="center" valign="top">-</td>
<td align="left" valign="top">nullAnnot</td>
<td valign="top">enable annotation based null analysis.<br/>
If desired, the annotation types to be interpreted by the compiler can be specified
by appending (nullable|nonnull|nonnullbydefault),
where each annotation type is specified using its fully qualified name.<br/>
Multiple sets of annotation types can be specified by repeatedly passing this option
(see also the corresponding <a href="../reference/preferences/java/compiler/ref-preferences-errors-warnings.htm#null_annotation_names">preference</a>).<br/>
<i>Usage example: nullAnnot(p.Nullable|p.NonNull|p.NonNullByDefault)</i><br/>
Enabling this option enables all null-annotation related sub-options. These can be individually
controlled using options listed below</td>
</tr>
<tr>
<td align="center" valign="top">-</td>
<td align="left" valign="top">nullAnnotConflict</td>
<td valign="top">report conflicts between null annotation specified and nullness inferred. Is effective
only with the nullAnnot option enabled.</td>
</tr>
<tr>
<td align="center" valign="top">-</td>
<td align="left" valign="top">nullAnnotRedundant</td>
<td valign="top">report redundant specification of null annotation. Is effective
only with the nullAnnot option enabled.</td>
</tr>
<tr>
<td align="center" valign="top">-</td>
<td align="left" valign="top">nullDereference</td>
<td valign="top">missing null check</td>
</tr>
<tr>
<td align="center" valign="top">-</td>
<td align="left" valign="top">nullUncheckedConversion</td>
<td valign="top">report unchecked conversion from unannotated type to @NonNull type. Is effective
only with the nullAnnot option enabled.</td>
</tr>
<tr>
<td align="center" valign="top">-</td>
<td align="left" valign="top">over-ann</td>
<td valign="top">missing @Override annotation (superclass only)</td>
</tr>
<tr>
<td align="center" valign="top">-</td>
<td align="left" valign="top">paramAssign</td>
<td valign="top">assignment to a parameter</td>
</tr>
<tr>
<td align="center" valign="top">+</td>
<td align="left" valign="top">pkgDefaultMethod</td>
<td valign="top">attempt to override package-default method</td>
</tr>
<tr>
<td align="center" valign="top">+</td>
<td align="left" valign="top">raw</td>
<td valign="top">usage a of raw type (instead of a parameterized type)</td>
</tr>
<tr>
<td align="center" valign="top">+/-</td>
<td align="left" valign="top">resource</td>
<td valign="top">(potentially) unsafe usage of resource of type Closeable</td>
</tr>
<tr>
<td align="center" valign="top">-</td>
<td align="left" valign="top">semicolon</td>
<td valign="top">unnecessary semicolon or empty statement</td>
</tr>
<tr>
<td align="center" valign="top">+</td>
<td align="left" valign="top">serial</td>
<td valign="top">missing serialVersionUID</td>
</tr>
<tr>
<td align="center" valign="top">-</td>
<td align="left" valign="top">specialParamHiding</td>
<td valign="top">constructor or setter parameter hiding another field</td>
</tr>
<tr>
<td align="center" valign="top">+/-</td>
<td align="left" valign="top">static-access</td>
<td valign="top">macro for indirectStatic and staticReceiver</td>
</tr>
<tr>
<td align="center" valign="top">-</td>
<td align="left" valign="top">static-method</td>
<td valign="top">an instance method that could be as a static method</td>
</tr>
<tr>
<td align="center" valign="top">+</td>
<td align="left" valign="top">staticReceiver</td>
<td valign="top">if a non static receiver is used to get a static field or call a static method</td>
</tr>
<tr>
<td align="center" valign="top">-</td>
<td align="left" valign="top">super</td>
<td valign="top">overriding a method without making a super invocation</td>
</tr>
<tr>
<td align="center" valign="top">+</td>
<td align="left" valign="top">suppress</td>
<td valign="top">enable @SuppressWarnings</td>
</tr>
<tr>
<td align="center" valign="top">-</td>
<td align="left" valign="top">switchDefault</td>
<td valign="top">switch statement lacking a default case</td>
</tr>
<tr>
<td align="center" valign="top">-</td>
<td align="left" valign="top">syncOverride</td>
<td valign="top">missing synchronized in synchronized method override</td>
</tr>
<tr>
<td align="center" valign="top">-</td>
<td align="left" valign="top">syntacticAnalysis</td>
<td valign="top">perform syntax-based null analysis for fields</td>
</tr>
<tr>
<td align="center" valign="top">-</td>
<td align="left" valign="top">syntheticAccess</td>
<td valign="top">when performing synthetic access for innerclass</td>
</tr>
<tr>
<td align="center" valign="top">-</td>
<td align="left" valign="top">tasks</td>
<td valign="top">enable support for tasks tags in source code</td>
</tr>
<tr>
<td align="center" valign="top">+</td>
<td align="left" valign="top">typeHiding</td>
<td valign="top">type parameter hiding another type</td>
</tr>
<tr>
<td align="center" valign="top">+</td>
<td align="left" valign="top">unavoidableGenericProblems</td>
<td valign="top">report even unavoidable type safety problems due to raw APIs</td>
</tr>
<tr>
<td align="center" valign="top">+</td>
<td align="left" valign="top">unchecked</td>
<td valign="top">unchecked type operation</td>
</tr>
<tr>
<td align="center" valign="top">-</td>
<td align="left" valign="top">unnecessaryElse</td>
<td valign="top">unnecessary else clause</td>
</tr>
<tr>
<td align="center" valign="top">-</td>
<td align="left" valign="top">unqualifiedField</td>
<td valign="top">unqualified reference to field</td>
</tr>
<tr>
<td align="center" valign="top">+/-</td>
<td align="left" valign="top">unused</td>
<td valign="top">macro for deadCode, intfRedundant, unusedAllocation, unusedExceptionParam, unusedImport, unusedLabel, unusedLocal, unusedParam, unusedPrivate, unusedThrown, unusedTypeArgs, and unusedTypeParameter</td>
</tr>
<tr>
<td align="center" valign="top">-</td>
<td align="left" valign="top">unusedAllocation</td>
<td valign="top">allocating an object that is not used</td>
</tr>
<tr>
<td align="center" valign="top">-</td>
<td align="left" valign="top">unusedArgument</td>
<td valign="top">unused method parameter <i>(deprecated option; use unusedParam instead)</i></td>
</tr>
<tr>
<td align="center" valign="top">+</td>
<td align="left" valign="top">unusedImport</td>
<td valign="top">unused import reference</td>
</tr>
<tr>
<td align="center" valign="top">+</td>
<td align="left" valign="top">unusedLabel</td>
<td valign="top">unused label</td>
</tr>
<tr>
<td align="center" valign="top">+</td>
<td align="left" valign="top">unusedLocal</td>
<td valign="top">unused local variable</td>
</tr>
<tr>
<td align="center" valign="top">+</td>
<td align="left" valign="top">unusedParam</td>
<td valign="top">unused method parameter</td>
</tr>
<tr>
<td align="center" valign="top">+</td>
<td align="left" valign="top">unusedParamImplementing</td>
<td valign="top">unused parameter for implementing method</td>
</tr>
<tr>
<td align="center" valign="top">+</td>
<td align="left" valign="top">unusedParamIncludeDoc</td>
<td valign="top">unused parameter documented in a Javadoc comment tag</td>
</tr>
<tr>
<td align="center" valign="top">+</td>
<td align="left" valign="top">unusedParamOverriding</td>
<td valign="top">unused parameter for overriding method</td>
</tr>
<tr>
<td align="center" valign="top">+</td>
<td align="left" valign="top">unusedPrivate</td>
<td valign="top">unused private member declaration</td>
</tr>
<tr>
<td align="center" valign="top">-</td>
<td align="left" valign="top">unusedThrown</td>
<td valign="top">unused declared thrown exception</td>
</tr>
<tr>
<td align="center" valign="top">-</td>
<td align="left" valign="top">unusedThrownIncludeDocComment</td>
<td valign="top">unused declared thrown exception documented in a Javadoc comment tag</td>
</tr>
<tr>
<td align="center" valign="top">-</td>
<td align="left" valign="top">unusedThrownExemptExceptionThrowable</td>
<td valign="top">report unused declared thrown exception but exempt Exception and Throwable</td>
</tr>
<tr>
<td align="center" valign="top">-</td>
<td align="left" valign="top">unusedThrownWhenOverriding</td>
<td valign="top">unused declared thrown exception in overriding method</td>
</tr>
<tr>
<td align="center" valign="top">+</td>
<td align="left" valign="top">unusedTypeArgs</td>
<td valign="top">unused type arguments for method and constructor</td>
</tr>
<tr>
<td align="center" valign="top">+</td>
<td align="left" valign="top">unusedTypeParameter</td>
<td valign="top">unused type parameter</td>
</tr>
<tr>
<td align="center" valign="top">-</td>
<td align="left" valign="top">uselessTypeCheck</td>
<td valign="top">unnecessary cast/instanceof operation</td>
</tr>
<tr>
<td align="center" valign="top">+</td>
<td align="left" valign="top">varargsCast</td>
<td valign="top">varargs argument need explicit cast</td>
</tr>
<tr>
<td align="center" valign="top">+/-</td>
<td align="left" valign="top">warningToken</td>
<td valign="top">unhandled or unused warning token in @SuppressWarnings</td>
</tr>
<!-- !!! YOU MUST ADJUST THE rowspan ABOVE IF YOU ADD/REMOVE A -warn SUB-OPTION !!! -->
<tr>
<td valign="top" id="nowarn">-nowarn</td>
<td colspan="3">No warning (equivalent to <span class="c3">-warn:none</span>)</td>
</tr>
<tr>
<td valign="top" width="250" id="err">-err:...</td>
<td valign="top" colspan="3">Specify the set of enabled warnings that are converted to errors.<br />
e.g. <span class="c3">-err:unusedLocal,deprecation</span><br />
unusedLocal and deprecation warnings will be converted to errors. All other warnings are still reported as warnings.
<table>
<tr>
<td>-err:&lt;warning tokens separated by ,&gt;</td>
<td>convert exactly the listed warnings to errors</td>
</tr>
<tr>
<td>-err:+&lt;warning tokens separated by ,&gt;</td>
<td>convert additional warnings to errors</td>
</tr>
<tr>
<td>-err:-&lt;warning tokens separated by ,&gt;</td>
<td>remove specific warnings from being converted to errors</td>
</tr>
</table>
</td>
</tr>
<tr>
<td valign="top" width="250" id="info">-info:...</td>
<td valign="top" colspan="3">Specify the set of enabled warnings that are converted to infos.<br />
e.g. <span class="c3">-info:unusedLocal,deprecation</span><br />
unusedLocal and deprecation warnings will be converted to infos. All other warnings are still reported as warnings.
<table>
<tr>
<td>-info:&lt;warning tokens separated by ,&gt;</td>
<td>convert exactly the listed warnings to infos</td>
</tr>
<tr>
<td>-info:+&lt;warning tokens separated by ,&gt;</td>
<td>convert additional warnings to infos</td>
</tr>
<tr>
<td>-info:-&lt;warning tokens separated by ,&gt;</td>
<td>remove specific warnings from being converted to infos</td>
</tr>
</table>
</td>
</tr>
<tr>
<td valign="top" id="deprecation">-deprecation</td>
<td colspan="3">Equivalent to <span class="c3">-warn:+deprecation</span>.</td>
</tr>
<tr>
<td valign="top" id="properties">-properties &lt;file&gt;</td>
<td colspan="3">Set warnings/errors option based on the properties file contents. This option can be used with -nowarn, -err:.. or -warn:.. options, but the last one on the command line sets the
options to be used.<br />
<p>The properties file contents can be generated by setting project specific settings on an existing java project and using the file in <code>.settings/org.eclipse.jdt.core.prefs</code> file as a
properties file, or a simple text file that is defined entry/value pairs using the constants defined in the <code>org.eclipse.jdt.core.JavaCore</code> class.
Of those constants declared in this class, all options starting with <code>"org.eclipse.jdt.core.compiler."</code> are interpreted by the batch compiler.</p>
<pre>
...
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
...
</pre>
<p>To ensure that a property file has the same effect when used in the IDE and for the batch compiler, use of the <code>-properties</code> option will change the defaults
for a few options:</p>
<table>
<tr><td><b>-g</b></td><td>default changed to <em>all enabled</em></td></tr>
<tr><td><b>-preserveAllLocals</b></td><td>default changed to <em>enabled</em></td></tr>
<tr><td><b>-enableJavadoc</b></td><td>default changed to <em>enabled</em></td></tr>
<tr><td>error/warning <b>forbidden</b></td><td>default changed to <em>error</em></td></tr>
</table>
</td>
</tr>
<tr>
<th colspan="4">Debug options</th>
</tr>
<tr>
<td valign="top" id="g">-g[:none|:lines,vars,source]</td>
<td colspan="3">Set the debug attributes level<br />
<table>
<tr>
<th align="left">-g</th>
<td colspan="3">All debug info (equivalent to <span class="c3">-g:lines,vars,source</span>)</td>
</tr>
<tr>
<th align="left">-g:none</th>
<td colspan="3">No debug info</td>
</tr>
<tr>
<th align="left">-g:[lines,vars,source]</th>
<td colspan="3">Selective debug info</td>
</tr>
</table>
Not specifying this option is equivalent to setting <span class="c3">-g:lines,source</span>.
</td>
</tr>
<tr>
<td valign="top" id="preserveAllLocals">-preserveAllLocals</td>
<td colspan="3">Explicitly request the compiler to preserve all local variables (for debug purpose). If omitted, the compiler will remove unused locals.</td>
</tr>
<tr>
<td valign="top" id="parameters">-parameters</td>
<td colspan="3">Explicitly request the compiler to preserve information about the formal parameters of a method (such as their names) to be accessed from
reflection libraries, annotation processing, code weaving, and in the debugger. This option is supported from target level 1.8 and later.</td>
</tr>
<tr>
<th colspan="4">Annotation processing options (require a 1.6 VM or above and are used only if the compliance is 1.6)</th>
</tr>
<tr>
<td valign="top" id="Akey">-Akey[=value]</td>
<td valign="top" colspan="3">Annotation processors options that are passed to annotation processors. <code>key</code> is made of identifiers separated by dots</td>
</tr>
<tr>
<td valign="top" id="proc">-proc:[only|none]</td>
<td valign="top" colspan="3">If <code>-proc:only</code> is specified, the annotation processors will run but no compilation will be performed. If <code>-proc:none</code> is specified, annotation
processors will not be discovered or run; compilation will proceed as if no annotation processors were found. By default the compiler must search the classpath for annotation processors, so
specifying <code>-proc:none</code> may speed compilation if annotation processing is not required.</td>
</tr>
<tr>
<td valign="top" id="processor">-processor &lt;class1[,class2,...]&gt;</td>
<td valign="top" colspan="3">Qualified class names of annotation processors to run. If specified, the normal <a href=
"http://download.oracle.com/javase/6/docs/api/javax/annotation/processing/Processor.html">processor discovery process</a> will be skipped.</td>
</tr>
<tr>
<td valign="top" id="processorpath">-processorpath &lt;dir&nbsp;1&gt;;&lt;dir&nbsp;2&gt;;...;&lt;dir&nbsp;P&gt;</td>
<td valign="top" colspan="3">A list of directories or jar files which will be searched for annotation processors. Entries are separated by the platform path separator. If not specified, the classpath
will be searched instead.</td>
</tr>
<tr>
<td valign="top" id="s">-s &lt;dir&gt;</td>
<td valign="top" colspan="3">The directory where generated source files will be created.</td>
</tr>
<tr>
<td valign="top" id="XprintProcessorInfo">-XprintProcessorInfo</td>
<td valign="top" colspan="3">Print information about which annotations and which elements a processor is asked to process</td>
</tr>
<tr>
<td valign="top" id="XprintRounds">-XprintRounds</td>
<td valign="top" colspan="3">Print information about annotation processing rounds</td>
</tr>
<tr>
<td valign="top" id="classNames">-classNames &lt;class1[,class2,...]&gt;</td>
<td valign="top" colspan="3">Qualified names of binary types that need to be processed</td>
</tr>
<tr>
<th colspan="4">Ignored options (for compatibility with javac options)</th>
</tr>
<tr>
<td valign="top" id="J">-J&lt;option&gt;</td>
<td valign="top" colspan="3">Pass option to the virtual machine</td>
</tr>
<tr>
<td valign="top" id="X">-X&lt;option&gt;</td>
<td valign="top" colspan="3">Specify non-standard option. -Xemacs is not ignored.</td>
</tr>
<tr>
<td valign="top">-X</td>
<td valign="top" colspan="3">Print non-standard options and exit</td>
</tr>
<tr>
<td valign="top" id="O">-O</td>
<td valign="top" colspan="3">Optimize for execution time</td>
</tr>
<tr>
<th colspan="4">Advanced options</th>
</tr>
<tr>
<td valign="top" id="file">@&lt;file&gt;</td>
<td valign="top" colspan="3">Read command-line arguments from file</td>
</tr>
<tr>
<td valign="top" id="maxProblems">-maxProblems&nbsp;&lt;n&gt;</td>
<td valign="top" colspan="3">Max number of problems per compilation unit (100 by default)</td>
</tr>
<tr>
<td valign="top" id="log">-log &lt;filename&gt;</td>
<td colspan="3">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 <b>.xml</b>, the generated log will be an xml file.</td>
</tr>
<tr>
<td valign="top" id="genericsignature">-genericsignature</td>
<td colspan="3">Explicitly request the compiler to preserve information about generic signature of lambda expressions.</td>
</tr>
<tr>
<td valign="top" id="Xemacs">-Xemacs</td>
<td colspan="3">Use emacs style to present errors and warnings locations into the console and regular text logs. XML logs are unaffected by this option. With this option active, the message:<br />
<code><span class="c3">2. WARNING in /workspace/X.java<br />
(at line 8)...</span></code><br />
is presented as:<br />
<code><span class="c3">/workspace/X.java:8: warning: The method...</span></code></td>
</tr>
<tr>
<td valign="top" id="proceedOnError">-proceedOnError[:Fatal]</td>
<td colspan="3">Keep compiling in spite of errors, dumping class files with problem methods or problem types. This is recommended only if you want to be able to run your application even if you have
remaining errors.<br />
With ":Fatal", all optional errors are treated as fatal and this leads to code that will abort if an error is reached at runtime. Without ":Fatal", optional errors don't prevent the proper code
generation and the produced .class files can be run without a problem.</td>
</tr>
<tr>
<td valign="top" id="failOnWarning">-failOnWarning</td>
<td colspan="3">Declare compilation unsuccessfull if there are warnings by calling <span class="c3">System.exit(-1)</span> at end of compilation.</td>
</tr>
<tr>
<td valign="top" id="verbose">-verbose</td>
<td colspan="3">Print accessed/processed compilation units in the console or the log file if specified.</td>
</tr>
<tr>
<td valign="top" id="referenceInfo">-referenceInfo</td>
<td colspan="3">Compute reference info. This is useful only if connected to the builder. The reference infos are useless otherwise.</td>
</tr>
<tr>
<td valign="top" id="progress">-progress</td>
<td colspan="3">Show progress (only in -log mode).</td>
</tr>
<tr>
<td valign="top" id="time">-time</td>
<td colspan="3">Display speed information.</td>
</tr>
<tr>
<td valign="top" id="noExit">-noExit</td>
<td colspan="3">Do not call <span class="c3">System.exit(n)</span> at end of compilation (<span class="c3">n=0</span> if no error).</td>
</tr>
<tr>
<td valign="top" id="repeat">-repeat &lt;n&gt;</td>
<td colspan="3">Repeat compilation process <span class="c3">&lt;n&gt;</span> times (perf analysis).</td>
</tr>
<tr>
<td valign="top" id="inlineJSR">-inlineJSR</td>
<td colspan="3">Inline JSR bytecode (implicit if target &gt;= 1.5).</td>
</tr>
<tr>
<td valign="top" id="enableJavadoc">-enableJavadoc</td>
<td colspan="3">Consider references inside Javadoc. The Javadoc options are effective only when this option is enabled.</td>
</tr>
<tr>
<td valign="top" id="missingNullDefault">-missingNullDefault</td>
<td colspan="3">When annotation based null analysis is enabled (using "nullAnnot", above), this option
will raise a warning whenever there is no default annotation on a package or a type.</td>
</tr>
<tr>
<td valign="top" id="annotationpath">-annotationpath</td>
<td colspan="3">When annotation based null analysis is enabled (using "nullAnnot", above), this option
defines locations where to find <a href="task-using_external_null_annotations.htm">external annotations</a> to support annotation-based null analysis.<br />
The value of this options is a list of directories or zip files. Entries are separated by the platform path separator.<br />
The special name CLASSPATH will cause lookup of external annotations from the classpath and sourcepath.</td>
</tr>
<tr>
<th colspan="4">Helping options</th>
</tr>
<tr>
<td valign="top" id="help">-? -help</td>
<td valign="top" colspan="3">Display the help message.</td>
</tr>
<tr>
<td valign="top" id="v">-v -version</td>
<td colspan="3">Display the build number of the compiler. This is very useful to report a bug.</td>
</tr>
<tr>
<td valign="top" id="showversion">-showversion</td>
<td colspan="3">Display the build number of the compiler and continue. This is very useful to report a bug.</td>
</tr>
</table>
<h4>Examples</h4>
<table>
<tr>
<td valign="top"><code><span class="c3">d:\temp -classpath rt.jar -time -g -d d:/tmp</span></code></td>
<td valign="top">It compiles all source files in d:\temp and its subfolders. The classpath is simply rt.jar. It generates all debug attributes and all generated .class files are dumped in d:\tmp. The
speed of the compiler will be displayed once the batch process is completed.</td>
</tr>
<tr>
<td valign="top"><code><span class="c3">d:\temp\Test.java -classpath d:\temp;rt.jar -g:none</span></code></td>
<td valign="top">It compiles only Test.java and its dependant files if any, retrieving dependant files from d:\temp. The classpath is d:\temp followed by rt.jar, which means that all necessary
classes are searched first in d:\temp and then in rt.jar. It generates no debug attributes and all generated .class files are dumped in d:\temp.</td>
</tr>
</table>
</body>
</html>