# JAVA\_HOME problem

**URL:** <https://discuss.gradle.org/t/java-home-problem/5157>\
**Category:** Old Forum Archive\
**Created:** [October 11, 2014, 6:23pm UTC](https://discuss.gradle.org/t/java-home-problem/5157 "2014-10-11T18:23:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![william\_wilkerson](https://avatars.discourse-cdn.com/v4/letter/w/df705f/32.png) [@william\_wilkerson](https://discuss.gradle.org/u/william_wilkerson)\
**Post date:** [October 11, 2014, 6:23pm UTC](https://discuss.gradle.org/t/java-home-problem/5157/1 "2014-10-11T18:23:00Z")

</div>

when i run gradlew setupDecompWorkspace it returns setup failed and says please set JAVA\_HOME variable in your environment to match location on your java installation. iv done this and it says the same thing.

ERROR: JAVA\_HOME is set to an invalid directory: C:\Program Files\Java\jre8

Please set the JAVA\_HOME variable in your environment to match the location of your Java installation

in eclipse preferences, java, build Path, Classpath Variables i have JAVA\_HOME - C:\Program Files\Java\jre8

and in Control Panel\System and Security\System under Advanced system settings, advanced, environment variables, system variables i have JAVA\_HOME set to C:\Program Files\Java\jre8

---

<div class="post-metadata">

**Author:** ![mark\_vieira](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/mark_vieira/32/5396_2.png) [@mark\_vieira](https://discuss.gradle.org/u/mark_vieira)\
**Post date:** [October 11, 2014, 6:38pm UTC](https://discuss.gradle.org/t/java-home-problem/5157/2 "2014-10-11T18:38:00Z")

</div>

‘JAVA\_HOME’ needs to point to a JDK installation, not a JRE. On Windows this should be something like _C:\Program Files\Java\jdk1.8.0_.

---

<div class="post-metadata">

**Author:** ![william\_wilkerson](https://avatars.discourse-cdn.com/v4/letter/w/df705f/32.png) [@william\_wilkerson](https://discuss.gradle.org/u/william_wilkerson)\
**Post date:** [October 12, 2014, 7:56pm UTC](https://discuss.gradle.org/t/java-home-problem/5157/3 "2014-10-12T19:56:00Z")

</div>

thank you so much it works now. thank you for the help
