Compiler
The compiler preferences are separated in the following sections:
- Problems
- Style
- Compliance and Class files
- Build Path
Problems
Option
Description
Default
Unreachable code
Unreachable code can optionally be reported as an error, warning or simply ignored. The byte code generation will always optimized it out. Note that according to the Java language specification, unreachable code should be an error.
Error
Unresolvable import statements
An import statement that cannot be resolved might optionally be reported as an error, as a warning or ignored. Note that according to the Java language specification, unresolved import statements should be an error.
Error
Unused local variables (i.e. never read)
When enabled, the compiler will issue an error or a warning for unused local variables (i.e. variables never read from).
Ignore
Unused parameters (i.e. never read)
When enabled, the compiler will issue an error or a warning for unused method parameters (i.e. parameters never read from).
Ignore
Unused imports
When enabled, the compiler will issue an error or a warning for unused import reference.
Warning
Unused private types, methods or fields
When enabled, the compiler will issue an error or a warning whenever a private method or field is declared but never used within the same unit.
Ignore
Usage of non-externalized strings
When enabled, the compiler will issue an error or a warning for non externalized String literal (i.e. non tagged with //$NON-NLS-<n>$).
Ignore
Usage of deprecated API
When enabled, the compiler will signal use of deprecated API either as an error or a warning.
Warning
Signal use of deprecated API inside deprecated code
When enabled, the compiler will signal use of deprecated API inside deprecated code. The severity of the problem is controlled with option "Usage of deprecated API".
Off
Maximum number of problems reported per compilation unit
Specifies the maximum number of problems reported per compilation unit.
100
Style
Option
Description
Default
Methods overridden but not package visible
A package default method is not visible in a different package, and thus cannot be overridden. When enabling this option, the compiler will signal such scenario either as an error or a warning.
Warning
Methods with a constructor name
Naming a method with a constructor name is generally considered poor style programming. When enabling this option, the compiler will signal such scenario either as an error or a warning.
Warning
Conflict of interface method with protected 'Object' method
When enabled, the compiler will issue an error or a warning whenever an interface defines a method incompatible with a non-inherited Object method. Until this conflict is resolved, such an interface cannot be implemented, e.g.
interface I {
int clone();
}
Warning
Hidden catch blocks
Locally to a try statement, some catch blocks may hide others , e.g.
try { throw new java.io.CharConversionException();
} catch (java.io.CharConversionException e) {
} catch (java.io.IOException e) {}.
When enabling this option, the compiler will issue an error or a warning for hidden catch blocks corresponding to checked exceptions.
Warning
Non-static access to a static member
When enabled, the compiler will issue an error or a warning whenever a static field or method is accessed with an expression receiver. A reference to a static member should be qualified with a type name.
Warning
Access to a non-accessible member of an enclosing type
When enabled, the compiler will issue an error or a warning whenever it emulates access to a non-accessible member of an enclosing type. Such accesses can have performance implications.
Ignore
Assignment has no effect (e.g. 'x = x')
When enabled, the compiler will issue an error or a warning whenever an assignment has no effect (e.g. 'x = x').
Warning
Using a char array in string concatenation
When enabled, the compiler will issue an error or a warning whenever a char[] expression is used in String concatenations,
"hello" + new char[]{'w','o','r','l','d'}Warning
Compliance and Class files
Option
Description
Default
Compiler compliance level
Specifies the JDK compiler compliance level.
1.3
Use default compliance settings
If enabled, the default compliance settings for the compiler compliance level are applied.
On
Generated class files compatibility
Specifies the generated class file compatibility.
1.1
Source compatibility
Specify whether source is 1.3 or 1.4 compatible. From 1.4 on, 'assert' is a keyword reserved for assertion support.
1.3
Report 'assert' as identifier
When enabled, the compiler will issue an error or a warning whenever 'assert' is used as an identifier (reserved keyword in JDK 1.4).
Ignore
Add variable attributes to generated class files
If enabled, variable attributes are added to the class file. This will enable local variable names to be displayed in the debugger (in places where variables are definitely assigned) The resulting .class file is then bigger.
On
Add line number attributes to generated class files
If enabled, line number information is added to the class file. This will enable source code highlighting in the debugger.
On
Add source file name to generated class file
If enabled, the source file name is added to the class file. This will enable the debugger to present the corresponding source code.
On
Preserve unused local variables
If enabled, unused local variables (i.e. never read) are not stripped from the class file. If stripped this potentially alters debugging.
On
Build Path
Option
Description
Default
Incomplete build path
Indicate the severity of the problem reported when an entry on the classpath does not exist, is not legitimate or is not visible (e.g. a reference project is closed).
Error
Circular dependencies
Indicate the severity of the problem reported when a project is involved in a cycle.
Error
Duplicated resources
Indicate the severity of the problem reported when more than one occurrence of a resource is to be copied into the output location.
Warning
Abort building on build path errors
Allow to toggle the builder to abort if the classpath is invalid.
On
Scrub output folders on full build
Indicate whether the Java Builder is allowed to clean the output folders when performing full build operations.
On
Enable using exclusion patterns in source folders
When disabled, no entry on a project classpath can be associated with an exclusion pattern.
On
Enable using multiple output locations for source folders
When disabled, no entry on a project classpath can be associated with a specific output location, preventing thus usage of multiple output locations.
On
Filtered resources
A comma separated list of file patterns which are not copied to the output folder.
''
Building a Java program
Working with build paths
Working with JREs