IntelliJ IDEA 2022.2 Help

Kotlin compiler

Use this page to configure Kotlin compiler-specific settings.

Common settings

Report compiler warnings

If this checkbox is cleared, the compiler won't generate warnings in course of compilation; only errors and info messages will be left.

Kotlin compiler version

Select the version of the Kotlin compiler that is used to run both local and CI builds.

Language version

Select the version of Kotlin used by the compiler.

API version

Select the API version used by the Kotlin compiler.

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 Expand component 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\".

Keep compiler process alive between invocations

If this checkbox is selected, the compiler process is always alive.

Kotlin to JVM

Enable incremental compilation

If this checkbox is selected, the improved incremental compilation is turned on.

Target JVM version

The version of the JVM bytecode that will be produced as the compilation result.

Kotlin to JavaScript

Enable incremental compilation

If this checkbox is selected, the improved incremental compilation is turned on.

Generate source maps

If this checkbox is selected, the compiler generates source maps that set the correspondence between lines in your Kotlin code and in the generated JavaScript code, otherwise your breakpoints will not be recognised and processed correctly.

Embed source code into source map

Select the mode for embedding source files into the source map:

  • Always. Source files are embeded into the source map in all cases.

  • Never. Source files are not embeded into the source map.

  • When inlining a function from other module with embedded sources. Source files of inline functions from other module are embeded into the source map only.

File to prepend to generated code

Specify the path to the file that will be added as is to the beginning of the generated code. You can enter the path manually, or click the Browse button and select the required file from the file chooser.

File to append to generated code

Specify the path to the file that will be added as is to the end of the generated code. You can enter the path manually, or click the Browse button and select the required file from the file chooser.

Copy library runtime files

If this checkbox is selected, the JavaScript files from the libraries will be copied to the folder specified in the field Destination directory.

Destination directory

This field is only enabled if the checkbox Copy library runtime files is selected. Specify here the target folder for the copied files.

Module kind

Select the kind of JS module generated by the compiler:

  • Plain. Doesn't compile for any module system. You can access a module by its name in the global scope.

  • AMD. Asynchronous Module Definition API is in particular used by the RequireJS library.

  • CommonJS. The CommonJS module formatting system is widely used by Node.js/npm (require function and module.exports object).

  • UMD. Unified Module Definition API is compatible with both AMD and CommonJS. UMD modules are also able to be executed without being imported or when no module system is present. This is the default option for the `browser` and `nodejs` targets.

Last modified: 19 July 2022