Provide a different JAVA_HOME for gradle daemon in eclipse

In our project we use IBM JDK 8 and gradle 2.14.1. They don’t work together very well (see GRADLE-3500), so I had to provide a separate java home for gradle to launch daemon correctly. But after that, gradle daemon can’t compile a project, because it uses oracle JVM instead of IBM.

How can I make eclipse launch the daemon using the oracle jvm, while still keeping the IBM java home (and make gradle daemon use the IBM JDK for compilation)?

The org.gradle.java.home value in your .gradle/gradle.properties file controls which JVM Gradle is started with.

For cross-compilation, see the Java plugin user guide (it mentions Java 6, but this applies to any JDK).

Ok, so I see the solution to change the gradle build file. But can I somehow do it without modifying the project file, only inside my local gradle configuration?

The actual path to your JDK will be inside your local configuration, but you still need to tell your build to configure the tasks accordingly. There is no auto-discover of JVMs out of the box at this point.