Stephan Herrmann | fc918f4 | 2017-10-14 19:16:55 +0200 | [diff] [blame] | 1 | .TH ecj "13 March 2017" |
Stephan Herrmann | 93860df | 2015-09-29 17:45:49 +0200 | [diff] [blame] | 2 | .LP |
| 3 | .SH NAME |
| 4 | ecj \- the eclipse JDT Batch Compiler |
Stephan Herrmann | fc918f4 | 2017-10-14 19:16:55 +0200 | [diff] [blame] | 5 | |
Stephan Herrmann | 93860df | 2015-09-29 17:45:49 +0200 | [diff] [blame] | 6 | .SH SYNOPSIS |
| 7 | .B ecj [OPTION]... [SOURCEFILE]... |
| 8 | .B ... |
| 9 | .SH DESCRIPTION |
| 10 | .B ecj is the batch compiler from Eclipse and is available as ecj.jar. |
| 11 | Since 3.3, this jar also contains the support for jsr199 (Compiler API) |
| 12 | and the support for jsr269 (Annotation processing). In order to use the |
| 13 | annotations processing support, a 1.6 VM is required. |
| 14 | |
| 15 | .SH OPTIONS SUMMARY |
| 16 | .sp |
| 17 | Here is a summary of all the options, grouped by type. Explanations are in the \fBOPTIONS\fR section. |
| 18 | .sp |
| 19 | .ul |
Stephan Herrmann | fc918f4 | 2017-10-14 19:16:55 +0200 | [diff] [blame] | 20 | Module Options |
| 21 | .sp |
Stephan Herrmann | 11a4993 | 2017-11-24 22:27:38 +0100 | [diff] [blame] | 22 | .B --add-exports \--add-modules \--add-reads \--limit-modules \-p|--module-path \--module-source-path \ --processor-module-path \--system |
Stephan Herrmann | fc918f4 | 2017-10-14 19:16:55 +0200 | [diff] [blame] | 23 | .sp |
| 24 | .ul |
Stephan Herrmann | 93860df | 2015-09-29 17:45:49 +0200 | [diff] [blame] | 25 | ClassPath Options |
| 26 | .sp |
| 27 | .B \-bootclasspath \-cp|\-classpath \-extdirs \-endorseddirs \-sourcepath \-d \-encoding |
| 28 | .sp |
| 29 | .ul |
| 30 | Compliance Options |
| 31 | .sp |
Stephan Herrmann | 11a4993 | 2017-11-24 22:27:38 +0100 | [diff] [blame] | 32 | .B \-target \-1.3 \-1.4 \-1.5 \-1.6 \-1.7 \-1.8 \1.9 \-source \ --release |
Stephan Herrmann | 93860df | 2015-09-29 17:45:49 +0200 | [diff] [blame] | 33 | .sp |
| 34 | .ul |
| 35 | Warning Options |
| 36 | .sp |
| 37 | .B \-?:warn \-help:warn \-warn:... \-nowarn \-err:... \-deprecation \-properties |
| 38 | .sp |
| 39 | .ul |
| 40 | Debug Options |
| 41 | .sp |
| 42 | \fB\-g \-preserveAllLocals \-parameters |
| 43 | .sp |
| 44 | .ul |
| 45 | Annotation Processing Options |
| 46 | .sp |
| 47 | \-Akey[=\fIvalue\fB] \-proc:[only|none] \-processor \-processorpath \-s \-XprintProcessorInfo \-XprintRounds \-classNames\fR |
| 48 | .sp |
| 49 | .ul |
| 50 | Ignored Options (for compatibility with javac options) |
| 51 | .sp |
| 52 | .B \-J \-X \-O |
| 53 | .sp |
| 54 | .ul |
| 55 | Advanced Options |
| 56 | .sp |
| 57 | \fB@<file> \-maxProblems \-log \-Xemacs \-proceedOnError \-verbose \-referenceInfo \-progress \-time \-noExit \-repeat \-inlineJSR \-enableJavaDoc \-missingNullDefault |
| 58 | .sp |
| 59 | .ul |
| 60 | Helping Options |
| 61 | .sp |
| 62 | \-? \-help \-v \-version \-showversion |
| 63 | |
| 64 | .SH OPTIONS |
| 65 | .sp |
| 66 | .ul |
Stephan Herrmann | fc918f4 | 2017-10-14 19:16:55 +0200 | [diff] [blame] | 67 | Module Options (Supported from 9 onwards) |
| 68 | |
| 69 | .B |
Stephan Herrmann | 11a4993 | 2017-11-24 22:27:38 +0100 | [diff] [blame] | 70 | .IP "--add-exports <source-module>/<package>=<target-module>(,<target-module>)*" |
| 71 | A command line form of exports statement which exports the package in source-module to the comma separated list of target modules. |
| 72 | |
| 73 | .B |
| 74 | .IP "--add-modules <module 1>,<module 2>,...,<module P>" |
| 75 | Extend the default set of root modules with a list of comma separated modules. |
| 76 | |
| 77 | .B |
| 78 | .IP "--add-reads <source-module>=<target-module> |
| 79 | A command line form of a requires clause equivalent to adding requires source-module in target modules module-info file. |
| 80 | |
| 81 | .B |
| 82 | .IP "--limit-modules <module 1>,<module 2>,...,<module P>" |
| 83 | Limit the observable modules to the list of comma separated modules. |
| 84 | |
| 85 | .B |
Stephan Herrmann | fc918f4 | 2017-10-14 19:16:55 +0200 | [diff] [blame] | 86 | .IP "-p|--module-path <dir 1>;<dir 2>;...;<dir P>" |
| 87 | This is a list of directories where application modules can be found. Entries are separated by the platform path separator. |
| 88 | |
| 89 | .B |
| 90 | .IP "--module-source-path <dir 1>;<dir 2>;...;<dir P>" |
| 91 | This is a list of directories where source files for modules can be found. Entries are separated by the platform path separator. |
| 92 | |
Stephan Herrmann | 11a4993 | 2017-11-24 22:27:38 +0100 | [diff] [blame] | 93 | .B |
| 94 | .IP "--processor-module-path <path>" |
| 95 | module path where annotation processors can be found. |
Stephan Herrmann | fc918f4 | 2017-10-14 19:16:55 +0200 | [diff] [blame] | 96 | |
| 97 | .B |
| 98 | .IP "--system <jdk>" |
| 99 | Override location of system modules. |
| 100 | |
| 101 | .P |
| 102 | .ul |
Stephan Herrmann | 93860df | 2015-09-29 17:45:49 +0200 | [diff] [blame] | 103 | ClassPath Options |
| 104 | |
| 105 | .B |
| 106 | .IP "\-bootclasspath <dir 1>;<dir 2>;...;<dir P>" |
| 107 | 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. |
| 108 | Each directory or file can specify access rules for types between '[' and ']'. |
| 109 | If no bootclasspath is specified, the compiler will infer it using the following system properties sun.boot.class.path, vm.boot.class.path or org.apache.harmony.boot.class.path in this order respectively |
| 110 | |
| 111 | .B |
| 112 | .IP "\-cp|\-classpath <dir 1>;dir2;...<dir P>" |
| 113 | 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. |
| 114 | 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). |
| 115 | The compiler follows the Class-Path 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. |
| 116 | |
| 117 | .B |
| 118 | .IP "\-extdirs <dir 1>;<dir 2>;...;<dir P>" |
| 119 | This is a list of directories used to specify the location of extension zip/jar files. Entries are separated by the platform path separator. |
| 120 | |
| 121 | .B |
| 122 | .IP "\-endorseddirs <dir 1>;<dir 2>;...;<dir P>" |
| 123 | This is a list of directories used to specify the location of endorsed zip/jar files. Entries are separated by the platform path separator. |
| 124 | |
| 125 | .B |
| 126 | .IP "\-sourcepath <dir 1>;<dir 2>;...;<dir P>" |
| 127 | This is a list of directories used to specify the source files. Entries are separated by the platform path separator. Each directory can specify access rules for types between '[' and ']'. |
| 128 | |
| 129 | .B |
| 130 | .IP "\-d <dir 1>|none" |
| 131 | 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. |
| 132 | If you want to generate no .class file at all, use \-d none. |
| 133 | |
| 134 | .B |
| 135 | .IP "\-encoding <encoding name>" |
| 136 | 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 [<encoding name>]. For example X.java[UTF-8] would specify the UTF-8 encoding for the compilation unit X.java located in the current user directory. |
| 137 | If multiple default source file encodings are specified, the last one will be used. |
| 138 | |
| 139 | For example: |
| 140 | .B ... \-encoding UTF-8 X.java[Cp1252] Y.java[UTF-16] Z.java .... |
| 141 | .br |
| 142 | All source files will be read using UTF-8 encoding (this includes Z.java). X.java will be read using Cp1252 encoding and Y.java will be read using UTF-16 encoding. |
| 143 | .sp |
| 144 | .B ... \-encoding UTF-8 -encoding UTF-16 .... |
| 145 | .br |
| 146 | All source files will be read using UTF-16 encoding. The \-encoding option for UTF-8 is ignored. |
| 147 | .sp |
| 148 | .B ... \-encoding Cp1252 /foo/bar/X.java[UTF-16] /foo/bar[UTF-8] .... |
| 149 | .br |
| 150 | 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. |
| 151 | |
| 152 | .P |
| 153 | .ul |
| 154 | Compliance Options |
| 155 | |
| 156 | .B |
Stephan Herrmann | fc918f4 | 2017-10-14 19:16:55 +0200 | [diff] [blame] | 157 | .IP "\-target 1.1 to 1.9 (or 9, 9.0, etc.)" |
Stephan Herrmann | 93860df | 2015-09-29 17:45:49 +0200 | [diff] [blame] | 158 | This specifies the .class file target setting. The possible value are: |
| 159 | .br |
| 160 | .B 1.1 |
| 161 | (major version: 45 minor: 3) |
| 162 | .br |
| 163 | .B 1.2 |
| 164 | (major version: 46 minor: 0) |
| 165 | .br |
| 166 | .B 1.3 |
| 167 | (major version: 47 minor: 0) |
| 168 | .br |
| 169 | .B 1.4 |
| 170 | (major version: 48 minor: 0) |
| 171 | .br |
| 172 | .B 1.5, 5 or 5.0 |
| 173 | (major version: 49 minor: 0) |
| 174 | .br |
| 175 | .B 1.6, 6 or 6.0 |
| 176 | (major version: 50 minor: 0) |
| 177 | .br |
| 178 | .B 1.7, 7 or 7.0 |
| 179 | (major version: 51 minor: 0) |
| 180 | .br |
| 181 | .B 1.8, 8 or 8.0 |
| 182 | (major version: 52 minor: 0) |
Stephan Herrmann | fc918f4 | 2017-10-14 19:16:55 +0200 | [diff] [blame] | 183 | .br |
| 184 | .B 1.9, 9 or 9.0 |
| 185 | (major version: 53 minor: 0) |
Stephan Herrmann | 93860df | 2015-09-29 17:45:49 +0200 | [diff] [blame] | 186 | |
| 187 | Defaults are: |
| 188 | .br |
| 189 | 1.1 in \-1.3 mode |
| 190 | .br |
| 191 | 1.2 in \-1.4 mode |
| 192 | .br |
| 193 | 1.5 in \-1.5 mode |
| 194 | .br |
| 195 | 1.6 in \-1.6 mode |
| 196 | .br |
| 197 | 1.7 in \-1.7 mode |
| 198 | .br |
| 199 | 1.8 in \-1.8 mode |
Stephan Herrmann | fc918f4 | 2017-10-14 19:16:55 +0200 | [diff] [blame] | 200 | .br |
| 201 | 1.9 in \-1.9 mode |
Stephan Herrmann | 93860df | 2015-09-29 17:45:49 +0200 | [diff] [blame] | 202 | clcd1.1 can be used to generate the StackMap attribute. |
| 203 | |
| 204 | .B |
| 205 | .IP \-1.3 |
| 206 | Set compliance level to 1.3. Implicit \-source 1.3 \-target 1.1. |
| 207 | |
| 208 | .B |
| 209 | .IP \-1.4 |
| 210 | Set compliance level to 1.4 (default). Implicit \-source 1.3 \-target 1.2. |
| 211 | |
| 212 | .B |
| 213 | .IP \-1.5 |
| 214 | Set compliance level to 1.5. Implicit \-source 1.5 \-target 1.5. |
| 215 | |
| 216 | .B |
| 217 | .IP \-1.6 |
| 218 | Set compliance level to 1.6. Implicit \-source 1.6 \-target 1.6. |
| 219 | |
| 220 | .B |
| 221 | .IP \-1.7 |
| 222 | Set compliance level to 1.7. Implicit \-source 1.7 \-target 1.7. |
| 223 | |
| 224 | .B |
| 225 | .IP \-1.8 |
| 226 | Set compliance level to 1.8. Implicit \-source 1.8 \-target 1.8. |
| 227 | |
| 228 | .B |
Stephan Herrmann | fc918f4 | 2017-10-14 19:16:55 +0200 | [diff] [blame] | 229 | .IP \-1.9 |
| 230 | Set compliance level to 1.9. Implicit \-source 1.9\-target 1.9. |
| 231 | |
| 232 | .B |
| 233 | .IP "\-source 1.1 to 1.9 (or 9, 9.0, etc.)" |
Stephan Herrmann | 93860df | 2015-09-29 17:45:49 +0200 | [diff] [blame] | 234 | This is used to specify the source level expected by the compiler. |
| 235 | The possible value are: |
| 236 | .br |
| 237 | .B 1.3 |
| 238 | .br |
| 239 | .B 1.4 |
| 240 | .br |
| 241 | .B 1.5, 5 or 5.0 |
| 242 | .br |
| 243 | .B 1.6, 6 or 6.0 |
| 244 | .br |
| 245 | .B 1.7, 7 or 7.0 |
| 246 | .br |
| 247 | .B 1.8, 8 or 8.0 |
Stephan Herrmann | fc918f4 | 2017-10-14 19:16:55 +0200 | [diff] [blame] | 248 | .br |
| 249 | .B 1.9, 9 or 9.0 |
Stephan Herrmann | 93860df | 2015-09-29 17:45:49 +0200 | [diff] [blame] | 250 | |
| 251 | Defaults are: |
| 252 | .br |
| 253 | 1.3 in \-1.3 mode |
| 254 | .br |
| 255 | 1.3 in \-1.4 mode |
| 256 | .br |
| 257 | 1.5 in \-1.5 mode |
| 258 | .br |
| 259 | 1.6 in \-1.6 mode |
| 260 | .br |
| 261 | 1.7 in \-1.7 mode |
| 262 | .br |
| 263 | 1.8 in \-1.8 mode |
| 264 | .br |
Stephan Herrmann | fc918f4 | 2017-10-14 19:16:55 +0200 | [diff] [blame] | 265 | 1.9 in \-1.9 mode |
| 266 | .br |
Stephan Herrmann | 93860df | 2015-09-29 17:45:49 +0200 | [diff] [blame] | 267 | In 1.4, assert is treated as a keyword. In 1.5 and 1.6, enum and assert are treated as keywords. |
| 268 | |
Stephan Herrmann | 11a4993 | 2017-11-24 22:27:38 +0100 | [diff] [blame] | 269 | .B |
| 270 | .IP "--release N" |
| 271 | Compile for a specific VM version. Used for compiling against older APIs. |
| 272 | |
Stephan Herrmann | 93860df | 2015-09-29 17:45:49 +0200 | [diff] [blame] | 273 | .P |
| 274 | .ul |
| 275 | Warning Options |
| 276 | |
| 277 | .B |
| 278 | .IP "\-?:warn \-help:warn" |
| 279 | Display advanced warning options |
| 280 | |
| 281 | .B |
| 282 | .IP "\-warn:..." |
| 283 | Specify the set of enabled warnings. |
| 284 | .br |
| 285 | .B \-warn:none\fR \t\t\t\t\t\tdisable all warnings |
| 286 | .br |
| 287 | .B \-warn:\fI<warning tokens separated by ,>\fR \tenable exactly the listed warnings |
| 288 | .br |
| 289 | .B \-warn:+\fI<warning tokens separated by ,>\fR \tenable additional warnings |
| 290 | .br |
| 291 | .B \-warn:\-\fI<warning tokens separated by ,>\fR \tdisable specific warnings |
| 292 | |
| 293 | Examples: |
| 294 | |
| 295 | .B\-warn:unusedLocal,deprecation |
| 296 | .br |
| 297 | enables only the given two warning options and disables all the other options |
| 298 | .sp |
| 299 | .B\-warn:\-unusedLocal,deprecation,+fallthrough |
| 300 | .br |
| 301 | disables unusedLocal and deprecation, enables fallthrough, and leaves the other warning options untouched |
| 302 | .sp |
| 303 | The first column below shows the default state for an option. 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. |
| 304 | .sp |
| 305 | |
| 306 | +/- |
| 307 | .B allDeadCode |
| 308 | dead code including trivial if (DEBUG) check |
| 309 | .sp |
| 310 | +/- |
| 311 | .B allDeprecation |
| 312 | deprecation even inside deprecated code |
| 313 | .sp |
| 314 | \ -\ |
| 315 | .B allJavadoc |
| 316 | invalid or missing Javadoc |
| 317 | .sp |
| 318 | \ -\ |
| 319 | .B allOver-ann |
| 320 | all missing @Override annotations (superclass and superinterfaces) |
| 321 | .sp |
| 322 | \ -\ |
| 323 | .B all-static-method |
| 324 | all method can be declared as static warnings |
| 325 | .sp |
| 326 | \ +\ |
| 327 | .B assertIdentifier |
| 328 | occurrence of assert used as identifier |
| 329 | .sp |
| 330 | \ -\ |
| 331 | .B boxing |
| 332 | autoboxing conversion |
| 333 | .sp |
| 334 | \ +\ |
| 335 | .B charConcat |
| 336 | when a char array is used in a string concatenation without being converted explicitly to a string |
| 337 | .sp |
| 338 | \ +\ |
| 339 | .B compareIdentical |
| 340 | comparing identical expressions |
| 341 | .sp |
| 342 | \ -\ |
| 343 | .B conditionAssign |
| 344 | possible accidental boolean assignment |
| 345 | .sp |
| 346 | \ +\ |
| 347 | .B constructorName |
| 348 | method with constructor name |
| 349 | .sp |
| 350 | \ +\ |
| 351 | .B deadCode |
| 352 | dead code excluding trivial if (DEBUG) check |
| 353 | .sp |
| 354 | \ -\ |
| 355 | .B dep\-ann |
| 356 | missing @Deprecated annotation |
| 357 | .sp |
| 358 | +/- |
| 359 | .B deprecation |
| 360 | usage of deprecated type or member outside deprecated code |
| 361 | .sp |
| 362 | \ +\ |
| 363 | .B discouraged |
| 364 | use of types matching a discouraged access rule |
| 365 | .sp |
| 366 | \ -\ |
| 367 | .B emptyBlock |
| 368 | undocumented empty block |
| 369 | .sp |
| 370 | \ +\ |
| 371 | .B enumIdentifier |
| 372 | occurrence of enum used as identifier |
| 373 | .sp |
| 374 | \ +\ |
| 375 | .B enumSwitch |
| 376 | incomplete enum switch |
| 377 | .sp |
| 378 | \ -\ |
| 379 | .B enumSwitchPedantic |
| 380 | report missing enum switch cases even in the presence of a default case |
| 381 | .sp |
| 382 | \ -\ |
| 383 | .B fallthrough |
| 384 | possible fall-through case |
| 385 | .sp |
| 386 | \ -\ |
| 387 | .B fieldHiding |
| 388 | field hiding another variable |
| 389 | .sp |
| 390 | \ +\ |
| 391 | .B finalBound |
| 392 | type parameter with final bound |
| 393 | .sp |
| 394 | \ +\ |
| 395 | .B finally |
| 396 | finally block not completing normally |
| 397 | .sp |
| 398 | \ +\ |
| 399 | .B forbidden |
| 400 | use of types matching a forbidden access rule |
| 401 | .sp |
| 402 | \ -\ |
| 403 | .B hashCode |
| 404 | missing hashCode() method when overriding equals() |
| 405 | .sp |
| 406 | +/- |
| 407 | .B hiding |
| 408 | macro for fieldHiding, localHiding, maskedCatchBlock, and typeHiding |
| 409 | .sp |
| 410 | \ -\ |
| 411 | .B includeAssertNull |
| 412 | raise null warnings for variables that got tainted in an assert expression |
| 413 | .sp |
| 414 | \ -\ |
| 415 | .B indirectStatic |
| 416 | indirect reference to static member |
| 417 | .sp |
| 418 | \ -\ |
| 419 | .B inheritNullAnnot |
| 420 | consider null annotations as being inherited from an overridden method to any overriding methods |
| 421 | .sp |
| 422 | \ +\ |
| 423 | .B intfAnnotation |
| 424 | annotation type used as super interface |
| 425 | .sp |
| 426 | \ +\ |
| 427 | .B intfNonInherited |
| 428 | interface non-inherited method compatibility |
| 429 | .sp |
| 430 | \ -\ |
| 431 | .B intfRedundant |
| 432 | find redundant superinterfaces |
| 433 | .sp |
| 434 | \ -\ |
| 435 | .B invalidJavadoc |
| 436 | macro to toggle the 'malformed Javadoc comments' option and all its sub-options listed below |
| 437 | .sp |
| 438 | \ -\ |
| 439 | .B invalidJavadocTag |
| 440 | report invalid Javadoc tags in Javadoc comments. |
| 441 | .sp |
| 442 | \ -\ |
| 443 | .B invalidJavadocTagDep |
| 444 | report invalid deprecated references in Javadoc tag arguments |
| 445 | .sp |
| 446 | \ -\ |
| 447 | .B invalidJavadocTagNotVisible |
| 448 | report invalid non-visible references in Javadoc tag arguments |
| 449 | .sp |
| 450 | \ -\ |
| 451 | .B invalidJavadocVisibility(\fI<visibility>\fB) |
| 452 | specify visibility modifier ("public", "protected" or "private") for malformed Javadoc tag warnings. Usage example: invalidJavadocVisibility(public) |
| 453 | .sp |
| 454 | \ -\ |
| 455 | .B javadoc |
| 456 | invalid Javadoc |
| 457 | .sp |
| 458 | \ -\ |
| 459 | .B localHiding |
| 460 | local variable hiding another variable |
| 461 | .sp |
| 462 | \ +\ |
| 463 | .B maskedCatchBlock |
| 464 | hidden catch block |
| 465 | .sp |
| 466 | \ -\ |
| 467 | .B missingJavadocTags |
| 468 | macro to toggle the 'missing Javadoc tags' option and all its sub-options listed below |
| 469 | .sp |
| 470 | \ -\ |
| 471 | .B missingJavadocTagsMethod |
| 472 | report missing Javadoc tags for a method's type parameters |
| 473 | .sp |
| 474 | \ -\ |
| 475 | .B missingJavadocTagsOverriding |
| 476 | report missing Javadoc tags in overriding methods |
| 477 | .sp |
| 478 | \ -\ |
| 479 | .B missingJavadocTagsVisibility(\fI<visibility>\fB) |
| 480 | specify visibility modifier ("public", "protected" or "private") for missing Javadoc tags warnings. Usage example: missingJavadocTagsVisibility(public) |
| 481 | .sp |
| 482 | \ -\ |
| 483 | .B missingJavadocComments |
| 484 | macro to toggle the 'missing Javadoc comments' option and all its sub-options listed below |
| 485 | .sp |
| 486 | \ -\ |
| 487 | .B missingJavadocCommentsOverriding |
| 488 | report missing Javadoc comments in overriding methods |
| 489 | .sp |
| 490 | \ -\ |
| 491 | .B missingJavadocCommentsVisibility(\fI<visibility>\fB) |
| 492 | specify visibility modifier ("public", "protected" or "private") for missing Javadoc comments warnings. Usage example: missingJavadocCommentsVisibility(public) |
| 493 | .sp |
| 494 | \ -\ |
| 495 | .B nls |
| 496 | non-nls string literals (lacking of tags //$NON-NLS-<n>) |
| 497 | .sp |
| 498 | \ +\ |
| 499 | .B noEffectAssign |
| 500 | assignment with no effect |
| 501 | .sp |
| 502 | \ +\ |
| 503 | .B nonnullNotRepeated |
| 504 | nonnull parameter annotation from overridden method is not repeated in an overriding method. Is effective only with the nullAnnot option enabled. |
| 505 | .sp |
| 506 | +/- |
| 507 | .B null |
| 508 | potential missing or redundant null check |
| 509 | .sp |
| 510 | \ -\ |
| 511 | .B nullAnnot |
| 512 | enable annotation based null analysis. |
| 513 | 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. |
| 514 | Usage example: nullAnnot(p.Nullable|p.NonNull|p.NonNullByDefault) |
| 515 | .sp |
| 516 | Enabling this option enables all null-annotation related sub-options. These can be individually controlled using options listed below |
| 517 | .sp |
| 518 | \ -\ |
| 519 | .B nullAnnotConflict |
| 520 | report conflicts between null annotation specified and nullness inferred. Is effective only with the nullAnnot option enabled. |
| 521 | .sp |
| 522 | \ -\ |
| 523 | .B nullAnnotRedundant |
| 524 | report redundant specification of null annotation. Is effective only with the nullAnnot option enabled. |
| 525 | .sp |
| 526 | \ -\ |
| 527 | .B nullDereference |
| 528 | missing null check |
| 529 | .sp |
| 530 | \ -\ |
| 531 | .B nullUncheckedConversion |
| 532 | report unchecked conversion from unannotated type to @NonNull type. Is effective only with the nullAnnot option enabled. |
| 533 | .sp |
| 534 | \ -\ |
| 535 | .B over-ann |
| 536 | missing @Override annotation (superclass only) |
| 537 | .sp |
| 538 | \ -\ |
| 539 | .B paramAssign |
| 540 | assignment to a parameter |
| 541 | .sp |
| 542 | \ +\ |
| 543 | .B pkgDefaultMethod |
| 544 | attempt to override package-default method |
| 545 | .sp |
| 546 | \ +\ |
| 547 | .B raw |
| 548 | usage a of raw type (instead of a parameterized type) |
| 549 | .sp |
| 550 | +/- |
| 551 | .B resource |
| 552 | (potentially) unsafe usage of resource of type Closeable |
| 553 | .sp |
| 554 | \ -\ |
| 555 | .B semicolon |
| 556 | unnecessary semicolon or empty statement |
| 557 | .sp |
| 558 | \ +\ |
| 559 | .B serial |
| 560 | missing serialVersionUID |
| 561 | .sp |
| 562 | \ -\ |
| 563 | .B specialParamHiding |
| 564 | constructor or setter parameter hiding another field |
| 565 | .sp |
| 566 | +/- |
| 567 | .B static-access |
| 568 | macro for indirectStatic and staticReceiver |
| 569 | .sp |
| 570 | \ -\ |
| 571 | .B static-method |
| 572 | an instance method that could be as a static method |
| 573 | .sp |
| 574 | \ +\ |
| 575 | .B staticReceiver |
| 576 | if a non static receiver is used to get a static field or call a static method |
| 577 | .sp |
| 578 | \ -\ |
| 579 | .B super |
| 580 | overriding a method without making a super invocation |
| 581 | .sp |
| 582 | \ +\ |
| 583 | .B suppress |
| 584 | enable @SuppressWarnings |
| 585 | .sp |
| 586 | \ -\ |
| 587 | .B switchDefault |
| 588 | switch statement lacking a default case |
| 589 | .sp |
| 590 | \ -\ |
| 591 | .B syncOverride |
| 592 | missing synchronized in synchronized method override |
| 593 | .sp |
| 594 | \ -\ |
| 595 | .B syntacticAnalysis |
| 596 | perform syntax-based null analysis for fields |
| 597 | .sp |
| 598 | \ -\ |
| 599 | .B syntheticAccess |
| 600 | when performing synthetic access for innerclass |
| 601 | .sp |
| 602 | \ -\ |
| 603 | .B tasks |
| 604 | enable support for tasks tags in source code |
| 605 | .sp |
| 606 | \ +\ |
| 607 | .B typeHiding |
| 608 | type parameter hiding another type |
| 609 | .sp |
| 610 | \ +\ |
| 611 | .B unavoidableGenericProblems |
| 612 | report even unavoidable type safety problems due to raw APIs |
| 613 | .sp |
| 614 | \ +\ |
| 615 | .B unchecked |
| 616 | unchecked type operation |
| 617 | .sp |
| 618 | \ -\ |
| 619 | .B unnecessaryElse |
| 620 | unnecessary else clause |
| 621 | .sp |
| 622 | \ -\ |
| 623 | .B unqualifiedField |
| 624 | unqualified reference to field |
| 625 | .sp |
| 626 | +/- |
| 627 | .B unused |
| 628 | macro for unusedImport, unusedLabel, unusedLocal, unusedPrivate, unusedThrown, unusedTypeArgs, and unusedTypeParameter |
| 629 | .sp |
| 630 | \ -\ |
| 631 | .B unusedAllocation |
| 632 | allocating an object that is not used |
| 633 | .sp |
| 634 | \ -\ |
| 635 | .B unusedArgument |
| 636 | unused method parameter (deprecated option; use unusedParam instead) |
| 637 | .sp |
| 638 | \ +\ |
| 639 | .B unusedImport |
| 640 | unused import reference |
| 641 | .sp |
| 642 | \ +\ |
| 643 | .B unusedLabel |
| 644 | unused label |
| 645 | .sp |
| 646 | \ +\ |
| 647 | .B unusedLocal |
| 648 | unused local variable |
| 649 | .sp |
| 650 | \ +\ |
| 651 | .B unusedParam |
| 652 | unused method parameter |
| 653 | .sp |
| 654 | \ +\ |
| 655 | .B unusedParamImplementing |
| 656 | unused parameter for implementing method |
| 657 | .sp |
| 658 | \ +\ |
| 659 | .B unusedParamIncludeDoc |
| 660 | unused parameter documented in a Javadoc comment tag |
| 661 | .sp |
| 662 | \ +\ |
| 663 | .B unusedParamOverriding |
| 664 | unused parameter for overriding method |
| 665 | .sp |
| 666 | \ +\ |
| 667 | .B unusedPrivate |
| 668 | unused private member declaration |
| 669 | .sp |
| 670 | \ -\ |
| 671 | .B unusedThrown |
| 672 | unused declared thrown exception |
| 673 | .sp |
| 674 | \ -\ |
| 675 | .B unusedThrownIncludeDocComment |
| 676 | unused declared thrown exception documented in a Javadoc comment tag |
| 677 | .sp |
| 678 | \ -\ |
| 679 | .B unusedThrownExemptExceptionThrowable |
| 680 | report unused declared thrown exception but exempt Exception and Throwable |
| 681 | .sp |
| 682 | \ -\ |
| 683 | .B unusedThrownWhenOverriding |
| 684 | unused declared thrown exception in overriding method |
| 685 | .sp |
| 686 | \ +\ |
| 687 | .B unusedTypeArgs |
| 688 | unused type arguments for method and constructor |
| 689 | .sp |
| 690 | \ +\ |
| 691 | .B unusedTypeParameter |
| 692 | unused type parameter |
| 693 | .sp |
| 694 | \ -\ |
| 695 | .B uselessTypeCheck |
| 696 | unnecessary cast/instanceof operation |
| 697 | .sp |
| 698 | \ +\ |
| 699 | .B varargsCast |
| 700 | varargs argument need explicit cast |
| 701 | .sp |
| 702 | +/- |
| 703 | .B warningToken |
| 704 | unhandled or unused warning token in @SuppressWarnings |
| 705 | .in |
| 706 | |
| 707 | .B |
| 708 | .IP "\-nowarn" |
| 709 | No warning (equivalent to \-warn:none) |
| 710 | .B |
| 711 | .IP "\-err:..." |
| 712 | Specify the set of enabled warnings that are converted to errors. |
| 713 | .br |
| 714 | E.g. |
| 715 | .br |
| 716 | .B \-err:unusedLocal,deprecation |
| 717 | .br |
| 718 | unusedLocal and deprecation warnings will be converted to errors. All other warnings are still reported as warnings. |
| 719 | |
| 720 | .B \-err:\fI<warning tokens separated by ,>\fR \tconvert exactly the listed warnings to errors |
| 721 | .br |
| 722 | .B \-err:+\fI<warning tokens separated by ,>\fR \tconvert additional warnings to errors |
| 723 | .br |
| 724 | .B \-err:\-\fI<warning tokens separated by ,>\fR \tremove specific warnings from being converted to errors |
| 725 | |
| 726 | .B |
| 727 | .IP \-deprecation |
| 728 | Equivalent to \-warn:+deprecation. |
| 729 | .B |
| 730 | .IP "\-properties <file>" |
| 731 | 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. |
| 732 | |
| 733 | The properties file contents can be generated by setting project specific settings on an existing java project and using the file in .settings/org.eclipse.jdt.core.prefs file as a properties file, or a simple text file that is defined entry/value pairs using the constants defined in the org.eclipse.jdt.core.JavaCore class. Of those constants declared in this class, all options starting with "org.eclipse.jdt.core.compiler." are interpreted by the batch compiler. |
| 734 | |
| 735 | ... |
| 736 | .br |
| 737 | org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning |
| 738 | .br |
| 739 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning |
| 740 | .br |
| 741 | org.eclipse.jdt.core.compiler.problem.autoboxing=ignore |
| 742 | .br |
| 743 | ... |
| 744 | .sp |
| 745 | To ensure that a property file has the same effect when used in the IDE and for the batch compiler, use of the \-properties option will change the defaults for a few options: |
| 746 | |
| 747 | .br |
| 748 | .B \-g\fR \t\t\t\t\tdefault changed to all enabled |
| 749 | .br |
| 750 | .B \-preserveAllLocals\fR \t\tdefault changed to enabled |
| 751 | .br |
| 752 | .B \-enableJavadoc\fR \t\tdefault changed to enabled |
| 753 | .br |
| 754 | error/warning \fBforbidden\fR \tdefault changed to error |
| 755 | |
| 756 | .P |
| 757 | .ul |
| 758 | Debug Options |
| 759 | |
| 760 | .B |
| 761 | .IP "\-g[:none|:lines,vars,source]" |
| 762 | Set the debug attributes level |
| 763 | .br |
| 764 | .B \-g\fR \t\t\t\t\tAll debug info (equivalent to \-g:lines,vars,source) |
| 765 | .br |
| 766 | .B \-g:none\fR \t\t\t\tNo debug info |
| 767 | .br |
| 768 | .B \-g:[lines,vars,source]\fR \tSelective debug info |
| 769 | .br |
| 770 | Not specifying this option is equivalent to setting \-g:lines,source. |
| 771 | |
| 772 | .B |
| 773 | .IP "\-preserveAllLocals" |
| 774 | Explicitly request the compiler to preserve all local variables (for debug purpose). If omitted, the compiler will remove unused locals. |
| 775 | .B |
| 776 | .IP "\-parameters" |
| 777 | 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. |
| 778 | Annotation processing options (require a 1.6 VM or above and are used only if the compliance is 1.6) |
| 779 | |
| 780 | .P |
| 781 | .ul |
| 782 | Annotation Processing Options |
| 783 | |
| 784 | .B |
| 785 | .IP "\-Akey[=value]" |
| 786 | Annotation processors options that are passed to annotation processors. key is made of identifiers separated by dots |
| 787 | |
| 788 | .B |
| 789 | .IP "\-proc:[only|none]" |
| 790 | If \-proc:only is specified, the annotation processors will run but no compilation will be performed. If \-proc:none 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 \-proc:none may speed compilation if annotation processing is not required. |
| 791 | .B |
| 792 | .IP "\-processor <class1[,class2,...]>" |
| 793 | Qualified class names of annotation processors to run. If specified, the normal processor discovery process will be skipped. |
| 794 | .B |
| 795 | .IP "\-processorpath <dir 1>;<dir 2>;...;<dir P>" |
| 796 | 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. |
| 797 | .B |
| 798 | .IP "\-s <dir>" |
| 799 | The directory where generated source files will be created. |
| 800 | .B |
| 801 | .IP "\-XprintProcessorInfo" |
| 802 | Print information about which annotations and which elements a processor is asked to process |
| 803 | .B |
| 804 | .IP "\-XprintRounds" |
| 805 | Print information about annotation processing rounds |
| 806 | .B |
| 807 | .IP "\-classNames <class1[,class2,...]>" |
| 808 | Qualified names of binary types that need to be processed |
| 809 | |
| 810 | .P |
| 811 | .ul |
| 812 | Ignored Options (for compatibility with javac options) |
| 813 | |
| 814 | .B |
| 815 | .IP "\-J<option>" |
| 816 | Pass option to the virtual machine |
| 817 | .B |
| 818 | .IP "\-X<option>" |
| 819 | Specify non-standard option. \-Xemacs is not ignored. |
| 820 | .B |
| 821 | .IP "\-X" |
| 822 | Print non-standard options and exit |
| 823 | .B |
| 824 | .IP "\-O" |
| 825 | Optimize for execution time |
| 826 | |
| 827 | .P |
| 828 | .ul |
| 829 | Advanced Options |
| 830 | |
| 831 | .B |
| 832 | .IP "@<file>" |
| 833 | Read command-line arguments from file |
| 834 | .B |
| 835 | .IP "\-maxProblems <n>" |
| 836 | Max number of problems per compilation unit (100 by default) |
| 837 | .B |
| 838 | .IP "\-log <filename>" |
| 839 | 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 an xml file. |
| 840 | .B |
| 841 | .IP "\-genericsignature" |
| 842 | Explicitly request the compiler to preserve information about generic signature of lambda expressions. |
| 843 | .B |
| 844 | .IP "\-Xemacs" |
| 845 | 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: |
| 846 | .br |
| 847 | \ \ \ \ 2. WARNING in /workspace/X.java |
| 848 | .br |
| 849 | \ \ \ \ (at line 8)... |
| 850 | .br |
| 851 | is presented as: |
| 852 | .br |
| 853 | \ \ \ \ /workspace/X.java:8: warning: The method... |
| 854 | .br |
| 855 | |
| 856 | .B |
| 857 | .IP "\-proceedOnError[:Fatal]" |
| 858 | 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. |
| 859 | 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. |
| 860 | .B |
| 861 | .IP "\-verbose" |
| 862 | Print accessed/processed compilation units in the console or the log file if specified. |
| 863 | .B |
| 864 | .IP "\-referenceInfo" |
| 865 | Compute reference info. This is useful only if connected to the builder. The reference infos are useless otherwise. |
| 866 | .B |
| 867 | .IP "\-progress" |
| 868 | Show progress (only in \-log mode). |
| 869 | .B |
| 870 | .IP "\-time" |
| 871 | Display speed information. |
| 872 | .B |
| 873 | .IP "\-noExit" |
| 874 | Do not call System.exit(n) at end of compilation (n=0 if no error). |
| 875 | .B |
| 876 | .IP "\-repeat <n>" |
| 877 | Repeat compilation process <n> times (perf analysis). |
| 878 | .B |
| 879 | .IP "\-inlineJSR" |
| 880 | Inline JSR bytecode (implicit if target >= 1.5). |
| 881 | .B |
| 882 | .IP "\-enableJavadoc" |
| 883 | Consider references inside Javadoc. The Javadoc options are effective only when this option is enabled. |
| 884 | .B |
| 885 | .IP "\-missingNullDefault" |
| 886 | 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. |
| 887 | .B |
| 888 | .IP "\-annotationpath" |
| 889 | When annotation based null analysis is enabled (using "nullAnnot", above), this option defines locations where to find external annotations to support annotation-based null analysis. |
| 890 | The value of this options is a list of directories or zip files. Entries are separated by the platform path separator. |
| 891 | The special name CLASSPATH will cause lookup of external annotations from the classpath and sourcepath. |
| 892 | |
| 893 | .P |
| 894 | .ul |
| 895 | Helping Options |
| 896 | |
| 897 | .B |
| 898 | .IP "\-? \-help" |
| 899 | Display the help message. |
| 900 | .B |
| 901 | .IP "\-v \-version" |
| 902 | Display the build number of the compiler. This is very useful to report a bug. |
| 903 | .B |
| 904 | .IP "\-showversion" |
| 905 | Display the build number of the compiler and continue. This is very useful to report a bug. |
| 906 | |
| 907 | .SH SEE ALSO |
| 908 | <\fBhttp://help.eclipse.org/topic/org.eclipse.jdt.doc.user/tasks/task-using_batch_compiler.htm\fR> |
| 909 | .SH BUGS |
| 910 | To report bugs, use <\fBhttps://bugs.eclipse.org/bugs/enter_bug.cgi?product=JDT&component=Core\fR> |
| 911 | .SH AUTHOR |
| 912 | For details on Eclipse committers, see <\fBhttp://www.eclipse.org/committers/\fR> |