| 36 |
is the classical way to invoke the batch compiler on a command-line. |
is the classical way to invoke the batch compiler on a command-line. |
| 37 |
<ul> |
<ul> |
| 38 |
<li> |
<li> |
| 39 |
For example on a command-line:</li> |
For example on a command-line: |
|
|
|
| 40 |
<br><font color="#3366FF">java -classpath jdtcore.jar org.eclipse.jdt.internal.compiler.batch.Main |
<br><font color="#3366FF">java -classpath jdtcore.jar org.eclipse.jdt.internal.compiler.batch.Main |
| 41 |
|
-classpath rt.jar A.java</font><br> |
| 42 |
|
or:<br> |
| 43 |
|
<font color="#3366FF">java -jar jdtcore.jar org.eclipse.jdt.internal.compiler.batch.Main |
| 44 |
-classpath rt.jar A.java</font> |
-classpath rt.jar A.java</font> |
| 45 |
|
</li> |
| 46 |
<li> |
<li> |
| 47 |
For example in a java source:</li> |
For example in a java source:</li> |
| 48 |
|
|
| 98 |
</td> |
</td> |
| 99 |
</tr> |
</tr> |
| 100 |
<tr> |
<tr> |
| 101 |
|
<td valign=top>-extdirs <dir 1>;<dir 2>;...;<dir P></td> |
| 102 |
|
<td valign=top>This is a list of directory used to specify the location of extension zip/jar files. Entries are separated by the platform path separator.</td> |
| 103 |
|
</tr> |
| 104 |
|
<tr> |
| 105 |
|
<td valign=top>-sourcepath <dir 1>;<dir 2>;...;<dir P></td> |
| 106 |
|
<td valign=top>This is a list of directory used to specify the source files. Entries are separated by the platform path separator.</td> |
| 107 |
|
</tr> |
| 108 |
|
<tr> |
| 109 |
<td valign=top bgcolor="#FFCCAA">-d <dir 1>|none</td> |
<td valign=top bgcolor="#FFCCAA">-d <dir 1>|none</td> |
| 110 |
<td bgcolor="#FFCCAA">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> |
<td bgcolor="#FFCCAA">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> |
| 111 |
If you don't want to generate .class files, use <font color="#3366FF">-d none</font>.</td> |
If you don't want to generate .class files, use <font color="#3366FF">-d none</font>.</td> |
| 118 |
<th colspan="2">Compliance options</th> |
<th colspan="2">Compliance options</th> |
| 119 |
</tr> |
</tr> |
| 120 |
<tr> |
<tr> |
| 121 |
<td valign=top>-target 1.1|1.2|1.3|1.4|1.5</td> |
<td valign=top>-target 1.1|1.2|1.3|1.4|1.5|5|5.0</td> |
| 122 |
<td>This specifies the classfile target setting. The possible value are <font color="#3366FF">1.1</font> or <font color="#3366FF">1.2</font>, default is <font color="#3366FF">1.2</font></td> |
<td>This specifies the classfile target setting. |
| 123 |
|
The possible value are: |
| 124 |
|
<ul> |
| 125 |
|
<li><font color="#3366FF">1.1</font> (major version: 45 minor: 3)</li> |
| 126 |
|
<li><font color="#3366FF">1.2</font> (major version: 46 minor: 0)</li> |
| 127 |
|
<li><font color="#3366FF">1.3</font> (major version: 47 minor: 0)</li> |
| 128 |
|
<li><font color="#3366FF">1.4</font> (major version: 48 minor: 0)</li> |
| 129 |
|
<li><font color="#3366FF">1.5</font>, <font color="#3366FF">5</font> or <font color="#3366FF">5.0</font> (major version: 49 minor: 0)</li> |
| 130 |
|
</ul> |
| 131 |
|
Defaults are: |
| 132 |
|
<ul> |
| 133 |
|
<li><font color="#3366FF">1.1</font> in <font color="#3366FF">-1.3</font> mode</li> |
| 134 |
|
<li><font color="#3366FF">1.2</font> in <font color="#3366FF">-1.4</font> mode</li> |
| 135 |
|
<li><font color="#3366FF">1.5</font> in <font color="#3366FF">-1.5</font> mode</li> |
| 136 |
|
</ul> |
| 137 |
|
</td> |
| 138 |
</tr> |
</tr> |
| 139 |
<tr> |
<tr> |
| 140 |
<td valign=top>-1.3</td> |
<td valign=top>-1.3</td> |
| 149 |
<td>Set compliance level to <font color="#3366FF">1.5</font>. Implicit -source 1.5 -target 1.5.</td> |
<td>Set compliance level to <font color="#3366FF">1.5</font>. Implicit -source 1.5 -target 1.5.</td> |
| 150 |
</tr> |
</tr> |
| 151 |
<tr> |
<tr> |
| 152 |
<td valign=top>-source 1.3|1.4|1.5</td> |
<td valign=top>-source 1.3|1.4|1.5|5|5.0</td> |
| 153 |
<td>This is used to enable the assertion support of the compiler. The possible value are: <font color="#3366FF">1.3</font> or <font color="#3366FF">1.4</font>, default is <font color="#3366FF">1.3</font> in <font color="#3366FF">-1.3</font> mode and <font color="#3366FF">1.4</font> in <font color="#3366FF">-1.4</font> mode. |
<td>This is used to enable the source level of the compiler.<br> |
| 154 |
In <font color="#3366FF">1.4</font>, <font color="#3366FF"><I>assert</I></font> is treated as a keyword.</td> |
The possible value are: |
| 155 |
|
<ul> |
| 156 |
|
<li><font color="#3366FF">1.3</font></li> |
| 157 |
|
<li><font color="#3366FF">1.4</font></li> |
| 158 |
|
<li><font color="#3366FF">1.5</font>, <font color="#3366FF">5</font> or <font color="#3366FF">5.0</font></li> |
| 159 |
|
</ul> |
| 160 |
|
Defaults are: |
| 161 |
|
<ul> |
| 162 |
|
<li><font color="#3366FF">1.3</font> in <font color="#3366FF">-1.3</font> mode</li> |
| 163 |
|
<li><font color="#3366FF">1.4</font> in <font color="#3366FF">-1.4</font> mode</li> |
| 164 |
|
<li><font color="#3366FF">1.5</font> in <font color="#3366FF">-1.5</font> mode</li> |
| 165 |
|
</ul> |
| 166 |
|
In <font color="#3366FF">1.4</font>, <font color="#3366FF"><I>assert</I></font> is treated as a keyword. In <font color="#3366FF">1.5</font>, <font color="#3366FF"><I>enum</I></font> and <font color="#3366FF"><i>assert</i></font> are treated as a keyword.</td> |
| 167 |
</tr> |
</tr> |
| 168 |
<tr> |
<tr> |
| 169 |
<th colspan="2">Warning options</th> |
<th colspan="2">Warning options</th> |
| 170 |
</tr> |
</tr> |
| 171 |
<tr> |
<tr> |
| 172 |
<td valign=top>-warn:<blockquote> allDeprecation<br>|allJavadoc<br>|<font color="#FF0000">assertIdentifier</font><br>|<font color="#FF0000">charConcat</font><br>|conditionAssign<br>|<font color="#FF0000">constructorName</font> |
<td valign=top>-warn:<blockquote>allDeprecation<br>allJavadoc<br><font color="#FF0000">assertIdentifier</font><br>boxing<br><font color="#FF0000">charConcat</font><br>conditionAssign<br><font color="#FF0000">constructorName</font> |
| 173 |
<br>|<font color="#FF0000">deprecation</font><br>|emptyBlock<br>|fieldHiding<br>|finalBound<br>|<font color="#FF0000">finally</font><br>|indirectStatic<br>|<font color="#FF0000">intfNonInherited</font><br>|javadoc<br>|localHiding |
<br>dep-ann<br><font color="#FF0000">deprecation</font><br>emptyBlock<br>enumSwitch<br>fieldHiding<br>finalBound<br><font color="#FF0000">finally</font><br>hiding<br>incomplete-switch<br>indirectStatic |
| 174 |
<br>|<font color="#FF0000">maskedCatchBlocks</font><br>|nls<br>|<font color="#FF0000">noEffectAssign</font><br>|<font color="#FF0000">pkgDefaultMethod</font><br>|<font color="#FF0000">serial</font><br>|semicolon<br> |
<br><font color="#FF0000">intfAnnotation</font><br><font color="#FF0000">intfNonInherited</font><br>javadoc<br>localHiding |
| 175 |
|specialParamHiding<br> |
<br><font color="#FF0000">maskedCatchBlocks</font><br>nls<br><font color="#FF0000">noEffectAssign</font><br>null<br>over-ann<br><font color="#FF0000">pkgDefaultMethod</font><br>semicolon<br><font color="#FF0000">serial</font><br> |
| 176 |
|<font color="#FF0000">staticReceiver</font><br>|syntheticAccess<br>|tasks(<task1>|...|<taskN>)<br>|unqualifiedField<br>|unnecessaryElse<br>|uselessTypeCheck<br> |
specialParamHiding<br>static-access<br><font color="#FF0000">staticReceiver</font><br><font color="#FF0000">suppress</font><br>synthetic-access<br>syntheticAccess<br>tasks(<task1>|...|<taskN>)<br> |
| 177 |
|<font color="#FF0000">unsafe</font><br>|unusedArgument<br>|<font color="#FF0000">unusedImport</font><br>|unusedLocal<br>|unusedPrivate<br>|unusedThrown</blockquote> |
<font color="#FF0000">typeHiding</font><br><font color="#FF0000">unchecked</font><br>unnecessaryElse<br>unqualified-field-access<br>unqualifiedField<br>uselessTypeCheck |
| 178 |
|
<br>unused<br>unusedArgument<br><font color="#FF0000">unusedImport</font><br><font color="#FF0000">unusedLocal</font><br><font color="#FF0000">unusedPrivate</font><br>unusedThrown |
| 179 |
|
<br><font color="#FF0000">varargsCast</font><br><font color="#FF0000">warningToken</font> |
| 180 |
|
</blockquote> |
| 181 |
</td> |
</td> |
| 182 |
<td valign=top>Set warning level.<br>e.g. <font color="#3366FF">-warn:unusedLocals,deprecation</font><br> |
<td valign=top>Set warning level.<br>e.g. <font color="#3366FF">-warn:unusedLocals,deprecation</font><br> |
| 183 |
<p>In <font color="#FF0000">red</font> are the default settings.</p> |
<p>In <font color="#FF0000">red</font> are the default settings.</p> |
| 201 |
<td valign=top>occurrence of <i>assert</i> used as identifier</td> |
<td valign=top>occurrence of <i>assert</i> used as identifier</td> |
| 202 |
</tr> |
</tr> |
| 203 |
<tr> |
<tr> |
| 204 |
|
<tr> |
| 205 |
|
<th align=left valign=top>boxing</th> |
| 206 |
|
<td valign=top>autoboxing conversion</td> |
| 207 |
|
</tr> |
| 208 |
|
<tr> |
| 209 |
<th align=left valign=top>charConcat</th> |
<th align=left valign=top>charConcat</th> |
| 210 |
<td valign=top>when a char array is used in a string concatenation without being converted explicitely to |
<td valign=top>when a char array is used in a string concatenation without being converted explicitely to |
| 211 |
a string</td> |
a string</td> |
| 219 |
<td valign=top>method with constructor name</td> |
<td valign=top>method with constructor name</td> |
| 220 |
</tr> |
</tr> |
| 221 |
<tr> |
<tr> |
| 222 |
|
<th align=left valign=top>dep-ann</th> |
| 223 |
|
<td valign=top>missing @Deprecated annotation</td> |
| 224 |
|
</tr> |
| 225 |
|
<tr> |
| 226 |
<th align=left valign=top>deprecation</th> |
<th align=left valign=top>deprecation</th> |
| 227 |
<td valign=top>usage of deprecated type or member outside deprecated code</td> |
<td valign=top>usage of deprecated type or member outside deprecated code</td> |
| 228 |
</tr> |
</tr> |
| 231 |
<td valign=top>undocumented empty block</td> |
<td valign=top>undocumented empty block</td> |
| 232 |
</tr> |
</tr> |
| 233 |
<tr> |
<tr> |
| 234 |
|
<th align=left valign=top>enumSwitch,<br>incomplete-switch</th> |
| 235 |
|
<td valign=top>incomplete enum switch</td> |
| 236 |
|
</tr> |
| 237 |
|
<tr> |
| 238 |
<th align=left valign=top>fieldHiding</th> |
<th align=left valign=top>fieldHiding</th> |
| 239 |
<td valign=top>field hiding another variable</td> |
<td valign=top>field hiding another variable</td> |
| 240 |
</tr> |
</tr> |
| 247 |
<td valign=top>finally block not completing normally</td> |
<td valign=top>finally block not completing normally</td> |
| 248 |
</tr> |
</tr> |
| 249 |
<tr> |
<tr> |
| 250 |
|
<th align=left valign=top>hiding</th> |
| 251 |
|
<td valign=top>macro for fieldHiding, localHiding, typeHiding and maskedCatchBlock</td> |
| 252 |
|
</tr> |
| 253 |
|
<tr> |
| 254 |
|
<th align=left valign=top>indirectStatic</th> |
| 255 |
|
<td valign=top>indirect reference to static member</td> |
| 256 |
|
</tr> |
| 257 |
|
<tr> |
| 258 |
|
<th align=left valign=top>intfAnnotation</th> |
| 259 |
|
<td valign=top>annotation type used as super interface</td> |
| 260 |
|
</tr> |
| 261 |
|
<tr> |
| 262 |
<th align=left valign=top>intfNonInherited</th> |
<th align=left valign=top>intfNonInherited</th> |
| 263 |
<td valign=top>interface non-inherited method compatibility</td> |
<td valign=top>interface non-inherited method compatibility</td> |
| 264 |
</tr> |
</tr> |
| 283 |
<td valign=top>for assignment with no effect</td> |
<td valign=top>for assignment with no effect</td> |
| 284 |
</tr> |
</tr> |
| 285 |
<tr> |
<tr> |
| 286 |
|
<th align=left valign=top>null</th> |
| 287 |
|
<td>missing or redundant null check</td> |
| 288 |
|
</tr> |
| 289 |
|
<tr> |
| 290 |
|
<th align=left valign=top>over-ann</th> |
| 291 |
|
<td>missing @Override annotation</td> |
| 292 |
|
</tr> |
| 293 |
|
<tr> |
| 294 |
<th align=left valign=top>pkgDefaultMethod</th> |
<th align=left valign=top>pkgDefaultMethod</th> |
| 295 |
<td valign=top>attempt to override package-default method</td> |
<td valign=top>attempt to override package-default method</td> |
| 296 |
</tr> |
</tr> |
| 307 |
<td valign=top>constructor or setter parameter hiding another field</td> |
<td valign=top>constructor or setter parameter hiding another field</td> |
| 308 |
</tr> |
</tr> |
| 309 |
<tr> |
<tr> |
| 310 |
|
<th align=left valign=top>static-access</th> |
| 311 |
|
<td valign=top>macro for indirectStatic and staticReceiver</td> |
| 312 |
|
</tr> |
| 313 |
|
<tr> |
| 314 |
<th align=left valign=top>staticReceiver</th> |
<th align=left valign=top>staticReceiver</th> |
| 315 |
<td valign=top>if a non static receiver is used to get a static field or call a static method</td> |
<td valign=top>if a non static receiver is used to get a static field or call a static method</td> |
| 316 |
</tr> |
</tr> |
| 317 |
<tr> |
<tr> |
| 318 |
<th align=left valign=top>syntheticAccess</th> |
<th align=left valign=top>suppress</th> |
| 319 |
|
<td valign=top>enable @SuppressWarnings</td> |
| 320 |
|
</tr> |
| 321 |
|
<tr> |
| 322 |
|
<th align=left valign=top>syntheticAccess,<br>synthetic-access</th> |
| 323 |
<td valign=top>when performing synthetic access for innerclass</td> |
<td valign=top>when performing synthetic access for innerclass</td> |
| 324 |
</tr> |
</tr> |
| 325 |
<tr> |
<tr> |
| 327 |
<td valign=top>enable support for tasks tags in source code</td> |
<td valign=top>enable support for tasks tags in source code</td> |
| 328 |
</tr> |
</tr> |
| 329 |
<tr> |
<tr> |
| 330 |
<th align=left valign=top>unqualifiedField</th> |
<th align=left valign=top>typeHiding</th> |
| 331 |
|
<td valign=top>type parameter hiding another type</td> |
| 332 |
|
</tr> |
| 333 |
|
<tr> |
| 334 |
|
<th align=left valign=top>unchecked</th> |
| 335 |
|
<td valign=top>unchecked type operation</td> |
| 336 |
|
</tr> |
| 337 |
|
<tr> |
| 338 |
|
<th align=left valign=top>unnecessaryElse</th> |
| 339 |
|
<td valign=top>unnecessary else clause</td> |
| 340 |
|
</tr> |
| 341 |
|
<tr> |
| 342 |
|
<th align=left valign=top>unqualified-field-access,<br>unqualifiedField</th> |
| 343 |
<td valign=top>unqualified reference to field</td> |
<td valign=top>unqualified reference to field</td> |
| 344 |
</tr> |
</tr> |
| 345 |
<tr> |
<tr> |
| 346 |
<th align=left valign=top>unsafe</th> |
<th align=left valign=top>unused</th> |
| 347 |
<td valign=top>unsafe type operation</td> |
<td valign=top>macro for unusedArgument, unusedImport, unusedLocal, unusedPrivate and unusedThrown</td> |
| 348 |
</tr> |
</tr> |
| 349 |
<tr> |
<tr> |
| 350 |
<th align=left valign=top>unusedArgument</th> |
<th align=left valign=top>unusedArgument</th> |
| 352 |
</tr> |
</tr> |
| 353 |
<tr> |
<tr> |
| 354 |
<th align=left valign=top>unusedImport</th> |
<th align=left valign=top>unusedImport</th> |
| 355 |
<td valign=top>When enabled, the compiler will issue an error or a warning for unused import reference |
<td valign=top>unused import reference</td> |
|
</td> |
|
| 356 |
</tr> |
</tr> |
| 357 |
<tr> |
<tr> |
| 358 |
<th align=left valign=top>unusedLocal</th> |
<th align=left valign=top>unusedLocal</th> |
| 367 |
<td valign=top>unused declared thrown exception</td> |
<td valign=top>unused declared thrown exception</td> |
| 368 |
</tr> |
</tr> |
| 369 |
<tr> |
<tr> |
|
<th align=left valign=top>unnecessaryElse</th> |
|
|
<td valign=top>unnecessary else clause</td> |
|
|
</tr> |
|
|
<tr> |
|
| 370 |
<th align=left valign=top>uselessTypeCheck</th> |
<th align=left valign=top>uselessTypeCheck</th> |
| 371 |
<td valign=top>unnecessary cast/instanceof operation</td> |
<td valign=top>unnecessary cast/instanceof operation</td> |
| 372 |
</tr> |
</tr> |
| 373 |
|
<tr> |
| 374 |
|
<th align=left valign=top>varargsCast</th> |
| 375 |
|
<td valign=top>varargs argument need explicit cast</td> |
| 376 |
|
</tr> |
| 377 |
|
<tr> |
| 378 |
|
<th align=left valign=top>warningToken</th> |
| 379 |
|
<td valign=top>unhandled warning token in @SuppressWarningsb</td> |
| 380 |
|
</tr> |
| 381 |
</table> |
</table> |
| 382 |
</td> |
</td> |
| 383 |
</tr> |
</tr> |
| 429 |
<tr> |
<tr> |
| 430 |
<td valign=top>-log <filename></td> |
<td valign=top>-log <filename></td> |
| 431 |
<td>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 |
<td>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 |
| 432 |
compiler or get a file which contains all errors and warnings from a batch build.</td> |
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 |
| 433 |
|
will be a xml file. |
| 434 |
|
</td> |
| 435 |
</tr> |
</tr> |
| 436 |
<tr> |
<tr> |
| 437 |
<td valign=top>-proceedOnError</td> |
<td valign=top>-proceedOnError</td> |