Java Compiler Preferences

The Opens the Java Compiler preference page Java > Compiler preference page lets you configure the various settings related to compiling of Java source code and class file generation.

An Eclipse-based product may change the compiler defaults, so they may be different than the ones indicated here.

Sub pages offer more compiler settings:

The options are:

JDK Compliance

Option

Description

Default

Compiler compliance level

Specifies the compiler compliance level.

1.4

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.2

Source compatibility

Specifies the compatibility of the accepted source code.

1.3

Disallow identifiers called 'assert'

When enabled, the compiler will issue an error or a warning whenever 'assert' is used as an identifier (reserved keyword in J2SE 1.4).

Warning

Disallow identifiers called 'enum'

When enabled, the compiler will issue an error or a warning whenever 'enum' is used as an identifier (reserved keyword in J2SE 1.5).

Warning

Classfile generation

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

Inline finally blocks

If enabled, finally blocks are inlined in the generated class files. This positively affects performance, but may result in larger class files.

Off

Store information about method parameters

If enabled, information about method parameters is stored in the generated class files.

Off

Related concepts

Java builder

Related tasks

Working with JREs

Related reference

Classpath variables preferences
Java build path properties
Building preference page
Errors/Warnings preference page
Javadoc preference page
Task tags preference page