I can\'t figure out to get this working.
Scenario:
What I w
I added this line in my GRADLE_HOME/bin/gradle file -
export JAVA_HOME=/path/to/java/version
For windows run gradle task with jdk 11 path parameter in quotes
gradlew clean build -Dorg.gradle.java.home="c:/Program Files/Java/jdk-11"
If you have this problem from Intellij, try this options
Set Gradle JVM Home
Set the JDK version in the Project module settings
As seen in Gradle (Eclipse plugin)
http://www.gradle.org/get-started
Gradle uses whichever JDK it finds in your path (to check, use java -version). Alternatively, you can set the JAVA_HOME environment variable to point to the install directory of the desired JDK.
If you are using this Eclipse plugin or Enide Studio 2014, alternative JAVA_HOME to use (set in Preferences) will be in version 0.15, see http://www.nodeclipse.org/history
If you add JDK_PATH in gradle.properties your build become dependent on on that particular path. Instead Run gradle task with following command line parametemer
gradle build -Dorg.gradle.java.home=/JDK_PATH
This way your build is not dependent on some concrete path.
Two ways
gradle.properties
in the .gradle
directory in your HOME_DIRECTORY
set org.gradle.java.home=/path_to_jdk_directory
or:
In your build.gradle
compileJava.options.fork = true
compileJava.options.forkOptions.executable = '/path_to_javac'