Qodana 2023.1 Help

Configure the JDK

Default versions

This table shows the JDK versions that are by default used by Qodana:

Using the default version of the JDK does not require any special configuration.

Available versions

Apart from the versions available by default, Qodana can automatically download and use these versions of JBR SDK for all JVM linters: 8, 11, 13, 15, 16, 17, 18, 19.

Otherwise, you can download the required JDK version, and mount it to Qodana.

Configure Qodana

In the qodana.yaml file, you can specify the JDK version using the projectJDK option, for example:

projectJDK: 11

or:

projectJDK: 1.8

You can also specify JDK using the name:

projectJDK: corretto-19

If you specify here any JDK from the list of available versions, it will be automatically downloaded by Qodana. If you would like to use the JDK beyond this list, you will have to download it and then mount it to Qodana.

Gradle

Gradle runs scripts based on the Compatibility Matrix meaning that the latest supported and downloadable version of the JDK will be set up as the Gradle JDK. Using the Compatibility Matrix in combination with the list of available JDK versions, you can find the JDK that will be used by Qodana. For example, in case of Gradle 6.6, Qodana will download and employ JDK 13.

Maven

In Maven, you can configure the source and target versions of the Java compiler. Qodana compares these values and selects the latest version. This version of the JDK is then searched in the list of available versions. If found, Qodana will download and use it. Otherwise, Qodana will download the subsequent version from this list.

Mount JDK

You can mount JDK from your local filesystem to the /root/.jdks folder of the Qodana Docker image:

$ docker run -v /path/to/jdk:/root/.jdks/jdk \ jetbrains/qodana-<linter>
Last modified: 02 June 2023