Set specific JDK in Gradle


What's inside this article ⌄
  • Gradle change jdk version
  • How to set Gradle Java version
  • Gradle specific jdk configuration
  • Gradle custom java home

If you’re working with IntelliJ IDEA you may notice that changing Project’s JDK version is not affected to Gradle build/run.

To force Gradle to use a specific JDK version / vendor, you merely need to change a Gradle JVM version in IntelliJ IDEA settings:

Settings → Build, Execution, Deployment → Build Tools → Gradle → Gradle JVM.