# Provide a different JAVA\_HOME for gradle daemon in eclipse

**URL:** <https://discuss.gradle.org/t/provide-a-different-java-home-for-gradle-daemon-in-eclipse/23786>\
**Category:** Buildship\
**Tags:** eclipse\
**Created:** [August 18, 2017, 11:07am UTC](https://discuss.gradle.org/t/provide-a-different-java-home-for-gradle-daemon-in-eclipse/23786 "2017-08-18T11:07:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![radistmorse](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/radistmorse/32/6410_2.png) [@radistmorse](https://discuss.gradle.org/u/radistmorse)\
**Post date:** [August 18, 2017, 11:07am UTC](https://discuss.gradle.org/t/provide-a-different-java-home-for-gradle-daemon-in-eclipse/23786/1 "2017-08-18T11:07:59Z")

</div>

In our project we use IBM JDK 8 and gradle 2.14.1. They don’t work together very well (see [GRADLE-3500](https://issues.gradle.org/browse/GRADLE-3500?_ga=2.134766706.26880910.1503048809-513095587.1500640527)), 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)?

---

<div class="post-metadata">

**Author:** ![st\_oehme](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/st_oehme/32/5249_2.png) [@st\_oehme](https://discuss.gradle.org/u/st_oehme)\
**Post date:** [August 18, 2017, 11:22am UTC](https://discuss.gradle.org/t/provide-a-different-java-home-for-gradle-daemon-in-eclipse/23786/2 "2017-08-18T11:22:02Z")

</div>

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](https://docs.gradle.org/current/userguide/java_plugin.html#sec:java_cross_compilation) (it mentions Java 6, but this applies to any JDK).

---

<div class="post-metadata">

**Author:** ![radistmorse](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/radistmorse/32/6410_2.png) [@radistmorse](https://discuss.gradle.org/u/radistmorse)\
**Post date:** [August 18, 2017, 11:39am UTC](https://discuss.gradle.org/t/provide-a-different-java-home-for-gradle-daemon-in-eclipse/23786/3 "2017-08-18T11:39:04Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![st\_oehme](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/st_oehme/32/5249_2.png) [@st\_oehme](https://discuss.gradle.org/u/st_oehme)\
**Post date:** [August 18, 2017, 12:56pm UTC](https://discuss.gradle.org/t/provide-a-different-java-home-for-gradle-daemon-in-eclipse/23786/4 "2017-08-18T12:56:36Z")

</div>

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.
