A simple question I couldn't figure out even after hours of trying and searching:
I have both Java 6 and 7 installed.
How do I tell IntelliJ to start Gradle builds with a JDK version 1.6?
No matter what I do, IntelliJ keeps starting my gradle with
"c:\program files\java\jdk1.7.0_10\jre\bin\java" -Dgradle.home=C:\_CODING_\gradle-1.4 [...]
I tried:
JAVA_HOME
is set to C:\Program Files\Java\jdk1.6.0_38
IDEA_JDK
did nothinggradle -v
recognizes 1.6 as its JDK on command lineIs there a setting somewhere to avoid Java 1.7 from being invoked?
... 2.5 years later:
I'm using IntelliJ IDEA 15.0, and I had a similar issue:
This version of IDEA ships bundled with JDK 1.8, and I want to build and run a Gradle project under JDK 1.7
The JDK used by Gradle is configurable in the preferences (may not have been the case earlier):
IDEA > Preferences > Build, Execution, Deployment > Build Tools > Gradle
... under "Use local gradle distribution" you should see the "Gradle JVM" property.
NOTE: in my case, it only appears to have taken effect after a system reboot. Something to try if it doesn't work right away!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With