IntelliJ IDEA 2019.3 Help

Gradle JVM selection

You can check a process of how IntelliJ IDEA selects the Gradle JVM version for installation when you create, open, or link a Gradle project.

Resolve the Gradle JVM version

IntelliJ IDEA executes the following steps one by one and installs Gradle JVM comparing the Java and Gradle supported versions. If IntelliJ IDEA can't achieve a positive result in the first step, it executes the second step, third, and so on until the correct Gradle JVM version is set.

  1. If you manually added Gradle JVM in Settings | Build, Execution, Deployment | Build Tools | Gradle, then this is the first place IntelliJ IDEA looks in and uses the JDK version specified in the Gradle JVM option.

    If IntelliJ IDEA doesn't find JDK in the specified location, it executes the next step.

  2. IntelliJ IDEA searches for the JDK version specified in the Project JDK option in File | Project Structure | Project. If JDK is found, IntelliJ IDEA verifies that the found JDK version is compatible with the Gradle version and sets Gradle JVM.

    If IntelliJ IDEA doesn't find JDK in the specified location, it executes the next step.

  3. IntelliJ IDEA searches for the default project JDK version in the Project SDK option located in File | Other Settings | Structure for new Projects | Project. If JDK is found, IntelliJ IDEA verifies that the found JDK version is compatible with the Gradle version and sets Gradle JVM.

    If IntelliJ IDEA doesn't find JDK in the specified location, it executes the next step.

  4. IntelliJ IDEA searches for the configured JDK with maximum supported version in the SDKs option located in File | Project Structure | Platform Settings. If JDK is found, IntelliJ IDEA verifies that the found JDK version is compatible with the Gradle version and sets Gradle JVM.

    If IntelliJ IDEA doesn't find JDK in the specified location, it executes the next step.

  5. IntelliJ IDEA searches for the JDK version defined in the JAVA_HOME environment variable. If JDK is found, IntelliJ IDEA verifies that the found JDK version is compatible with the Gradle version and sets Gradle JVM.

    If IntelliJ IDEA doesn't find JDK in the specified location, it executes the next step.

  6. IntelliJ IDEA searches for the JDK version in the common installation location in your file system. If JDK is found, IntelliJ IDEA verifies that the found JDK version is compatible with the Gradle version and sets Gradle JVM.

Gradle and Java supported versions

Gradle version

Java version

5.4.1+

1.8 - 12

5.0+

1.8 - 11

4.1+

1.7 - 9

4.0+

1.7 - 8

earlier

1.6 - 1.8

Last modified: 26 April 2020