I can't figure out to get this working.
Scenario:
What I want
I thought about having the gradle.properties
file, defining the variable. Something like
JAVA_HOME_FOR_MY_PROJECT=<path to my desired JDK>
What I don't want
JAVA_HOME
to the desired JDKI could live with many suggestions:
use JAVA_HOME=<my special JDK path defined somewhere else defined>
)Question:
gradle.properties
, system environment variable, ...) to the build process?I have more than one JDK7 available and need to point to a special version (minimum JDK_u version).
Any answer is appreciated and I'm thankful for every hint to the right direction.
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'