Compiler

The compiler preferences are separated in the following sections:

Errors and warnings

Option

Description

Default

Unreachable code

Unreachable code can optionally be reported as an error, warning or simply ignored. The bytecode generation will always optimized it out.

Error

Unresolvable import statements

An import statement that cannot be resolved might optionally be reported as an error, as a warning or ignored.

Error

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

Usage of deprecated API

When enabled, the compiler will signal use of deprecated API either as an error or a warning.

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

Unused imports

When enabled, the compiler will issue an error or a warning for unused import reference.

Ignore

Unused local variables

When enabled, the compiler will issue an error or a warning for unused local variables (i.e. variables never read from).

Ignore

Unused parameters

When enabled, the compiler will issue an error or a warning for unused method parameters (i.e. parameters never read from).

Ignore

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

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

Maximum number of problems reported per compilation unit

Specifies the maximum number of problems reported per compilation unit. 

100

Classfile generation

Option

Description

Default

Add variable attributes to generated class files

If enabled, variable attributes are added to the classfile. 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 classfile. 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 classfile. 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 classfile. If stripped this potentially alters debugging.

On

JDK compliance

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

Other

Option

Description

Default

Filtered resources

A comma separated list of file patterns which are not copied to the output folder. 

'*.launch'

Stop building when an invalid classpath is detected

If enabled, building aborts as soon as an invalid classpath is detected. 

On

Related concepts
Java builder

Related tasks
Building a Java program
Working with build paths
Working with JREs

Related reference
Classpath Variables preferences
Java Build Path properties

Copyright IBM Corporation 2000, 2002. All Rights Reserved.