IntelliJ IDEA 11.1 Web Help

File | Settings | Compiler | Java Compiler

Ctrl+Alt+SCommand Comma

IntelliJ IDEA | Preferences | Compiler | Java Compiler

Ctrl+Alt+SCommand Comma

Use the Compiler > Java Compiler page to select the Java compiler for your project and to specify the associated compiler settings.

Compiler

Item Description
Use compiler Select the desired compiler from the list of the supported ones:
  • Javac. This compiler is taken from the Java SDK currently assigned to the project.
  • Jikes. Jikes is not shipped with IntelliJ IDEA and should be downloaded separately.
  • Eclipse. IntelliJ IDEA comes bundled with the Eclipse compiler.
  • Javac in-process (Java 6+ only). This compiler works faster, but requires more memory resources.
  • Ajc. Similarly to Jikes, this compiler is not included in IntelliJ IDEA distribution and should be downloaded separately.

    Note that this compiler is shown in the list only if the AspectJ Support plugin is enabled.

The available settings depend on the compiler currently selected.

Compiler settings for Javac, Eclipse and Javac in-process

Item Description
Generate debugging info If this check box is selected, the compiler includes 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.
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\".
Maximum heap size (MB) The heap size available to the process that launches the compiler.

If you are compiling a particularly large or complex project, you may get out-of-memory errors and be required to increase the amount of memory allocated to the compiler.

Compiler settings for Jikes

Item Description
Path to Jikes executable Specify the path to Jikes.

Type the path in the field, or click browseButton and select the required file in the Select Path dialog.

Generate debugging info If this check box is selected, the compiler includes the information necessary for running the compiled classes in the debugger.
Generate no warnings If this check box is selected, the compiler omits the warnings about dubious usages of language constructs.
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.)
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\".

Compiler settings for Ajc

Item Description
Path to Ajc compiler Specify the path to Ajc (the file aspectjtools.jar which is located in <AJDK installation directory>\lib).

Type the path in the field, or click browseButton and select the required file in the Select Path dialog.

Maximum heap size (MB) If necessary, specify the maximum heap size for the compiler. (The default is 128 MB.)
Command line parameters If 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 that the aspectpath option may be specified separately, using the GUI provided below.

Test Click 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.)

Explicit aspect path If you want to specify the aspectpath option, select this check box, and then use the available controls (see below) to form the aspectpath.
add (Alt+InsertControl N ) Use this icon or shortcut to add project and global libraries to the list. Select the necessary library or libraries in the Choose Libraries dialog that opens.
delete (Alt+DeleteCommand Delete) Use this icon or shortcut to remove the selected items from the list.
arrowUp (Alt+UpControl Up) Use this icon or shortcut to move the selected item one line up in the list.
arrowDown (Alt+DownControl Down) Use this icon or shortcut to move the selected item one line down in the list.

See Also

Concepts:

Procedures:

Web Resources: