Reputation: 531
We have a preexisting developer kit which contains a variety of different JDKs we need because of reasons. This kit defines environment variables such as JDK_7
and JDK_8
pointing to the appropriate directories. These paths are stable inside the kit but are not stable between developer's and build automation machines. The build scripts we use for build automation rely on these variables to set the appropriate JDK in each case. Gradle recently introduced support for detecting toolchains from environment variables, which we are using with great success.
We are now evaluating using IntelliJ IDEA as an IDE for our projects, motivated by its great Gradle support. How can we configure IDEA with JDKs from environment variables?
It is acceptable for us to create a custom plugin to adapt IDEA to our developer kits. What extensions points can we use to inject JDKs into IDEA's platform or project settings?
Upvotes: 1
Views: 287
Reputation: 16391
IDE resolves the JVM for Gradle using below algorithm:
Checks the gradle.properties
file for the appropriate Gradle JVM specified in org.gradle.java.home
and uses it for the project.
Then it checks the JAVA_HOME
environment variable.
Then it checks the closest appropriate JDK version for the existing Gradle version.
There are related requests:
Upvotes: 1