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.

Depends on default JRE

Use --release option

If Selected, the system libraries from the selected compiler compliance level will be used with the '--release' compiler option using the current JRE. This option is valid, if the JRE being used is 9 or above and the compiler compliance is 1.6 or above.

Depends on default JRE

Use default compliance settings

If enabled, the default compliance settings for the compiler compliance level are applied.

On

Enable preview features

If enabled, the compiler will activate the preview language features of the Java version in use.

Off

Preview features with severity level

When enabled, the compiler will issue a warning when a preview language feature is used.

Warning

Generated class files compatibility

Specifies the generated class file compatibility.

Depends on default JRE

Source compatibility

Specifies the compatibility of the accepted source code.

Depends on default JRE

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

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