IntelliJ IDEA 2016.2 Help

Java Compiler

File | Settings | Build, Execution, Deployment | Compiler | Java Compiler for Windows and Linux
IntelliJ IDEA | Preferences | Build, Execution, Deployment | Compiler | Java Compiler for OS X


On the Compiler > Java Compiler page, you can select the Java compiler to be used and specify how it should be used.

Compiler and bytecode versions

ItemDescription
Use compiler Select the compiler to be used:
  • Javac. The compiler from the JDK that is currently assigned to the project is used.
  • Eclipse (also known as Eclipse Compiler for Java or ECJ). IntelliJ IDEA comes bundled with the Eclipse compiler.
  • Groovy-Eclipse. This compiler lets you perform a joint compilation of Groovy and Java codes using the Eclipse compiler.
  • Ajc (the AspectJ compiler). This option is available only in the Ultimate Edition of IntelliJ IDEA. Besides, the AspectJ compiler is not included in IntelliJ IDEA distribution and should be downloaded separately.

    See also, Ajc options, Using the AspectJ Compiler (ajc) and Enabling AspectJ Support Plugins.

Project bytecode versionSelect the version of bytecode to be generated. (Roughly, this is the minimum target JVM version.)

If no particular version is specified, the bytecode version is defined by the compiler.

To specify different versions for particular modules, use the controls in the Per-module bytecode version area.

Per-module bytecode versionIf necessary, specify the target bytecode versions for individual modules (e.g. if they should differ from that set for the project).

Click add and select the modules of interest in the dialog that opens. Then, for each of the modules, click the corresponding Target bytecode version cell and select the version from the list.

Use delete to remove the selected module or modules from the list.

Javac and Eclipse options

ItemDescription
Generate debugging info If this check box is selected, the compiler generates the information necessary for running the compiled classes in the debugger.
Report use of deprecated features If this check box is selected, the compiler displays warnings about the deprecated methods, classes, or fields encountered during compilation. (The corresponding warnings are shown in the compiler output window.)
Generate no warnings If this check box is selected, the compiler omits the warnings about dubious usages of language constructs.
Proceed on errorsFor the Eclipse compiler: If you select this check box, the compiler continues the compilation even when compilation errors occur.
Additional command line parameters Specify the command-line parameters and options to be passed to the compiler at its start. Refer to the compiler documentation for the available options.

If you need more room to type, click shift-enter-button to open the Additional command line parameters dialog where the text entry area is larger.

When specifying the parameters and options, follow these rules:

  • Use spaces to separate individual parameters and options, for example, -client -ea -Xmx1024m.
  • If a parameter or an option includes spaces, enclose the spaces or the argument that contains the spaces in double quotes, for example, some" "arg or "some arg".
  • If a parameter or an option includes double quotes (e.g. as part of the argument), escape the double quotes by means of the backslashes, for example, -Dmy.prop=\"quoted_value\".

Ajc options

The ajc options are available only in the Ultimate Edition of IntelliJ IDEA.

ItemDescription
Path to Ajc compilerSpecify the path to ajc (the file aspectjtools.jar which is located in <AspectJ installation directory>\lib).

Type the path in the field, or click browseButton and select the required file in the dialog that opens .

TestClick this button to check if the path and the command line parameters are correct.

If all is well, the compiler version is displayed. Otherwise, an error message is shown. (Using the path and the parameters specified, IntelliJ IDEA tries to launch the compiler with the additional -version parameter.)

Command line parametersIf necessary, specify the command-line options to be passed to the compiler.

You can type the parameters right in the field, or click shift-enter-button to open the Command line parameters dialog where the text entry area is larger.

When specifying the options, follow these rules:

  • Use spaces to separate individual options, for example, -client -ea -Xmx1024m.
  • If an option includes spaces, enclose the spaces or the argument that contains the spaces in double quotes, for example, some" "arg or "some arg".
  • If an option includes double quotes (e.g. as part of the argument), escape the double quotes by means of the backslashes, for example, -Dmy.prop=\"quoted_value\".

NOTE: The specified parameters are ignored when ajc is used for post-compile weaving.

See also, Optimizing compilation performance: Using ajc in combination with javac, Controlling the ajc aspectpath and Fine-tuning the use of ajc at a module level.

Generate debug infoIf this check box is selected, the compiler generates the information necessary for running the compiled classes in the debugger.
Delegate to JavacIf this option is off, ajc is used in all cases.

If this option is on, javac is used in addition to or instead of ajc. For example, javac will be used to compile the modules that contain no aspects. As a result, the compilation may become much faster.

See also, Optimizing compilation performance: Using ajc in combination with javac and Fine-tuning the use of ajc at a module level.

Groovy-Eclipse options

ItemDescription
Path to groovy-eclipse-batch jarSpecify a path to your groovy-eclipse-batch jar location. Click browseButton to open Select Path dialog, select the location of the .jar file and click OK.
Please note that it is necessary to enter the location of the groovy-eclipse-batch .jar file for the compiler to work correctly.
Additional command line parametersSpecify the command-line parameters and options to be passed to the compiler at its start. Refer to the compiler documentation for the available options.

If you need more room to type, click shift-enter-button to open the Additional command line parameters dialog where the text entry area is larger.

When specifying the parameters and options, follow these rules:

  • Use spaces to separate individual parameters and options, for example, -client -ea -Xmx1024m.
  • If a parameter or an option includes spaces, enclose the spaces or the argument that contains the spaces in double quotes, for example, some" "arg or "some arg".
  • If a parameter or an option includes double quotes (e.g. as part of the argument), escape the double quotes by means of the backslashes, for example, -Dmy.prop=\"quoted_value\".
Generate debug infoIf this check box is selected, the compiler generates the information necessary for running the compiled classes in the debugger.

See Also

Last modified: 23 November 2016