# Ionic Build Failed: JAVA\_HOME is invalid

**URL:** <https://forum.ionicframework.com/t/ionic-build-failed-java-home-is-invalid/49241>\
**Category:** ionic-v1\
**Created:** [April 13, 2016, 8:32pm UTC](https://forum.ionicframework.com/t/ionic-build-failed-java-home-is-invalid/49241 "2016-04-13T20:32:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Icarus619](https://avatars.discourse-cdn.com/v4/letter/i/3da27b/32.png) [@Icarus619](https://forum.ionicframework.com/u/Icarus619)\
**Post date:** [April 13, 2016, 8:32pm UTC](https://forum.ionicframework.com/t/ionic-build-failed-java-home-is-invalid/49241/1 "2016-04-13T20:32:35Z")

</div>

wanted to start my first build with ionic. But the Build fails very soon with the following error:

```
Running command: E:\Apps\ASV\Node\node.exe E:\Apps\ASV\Code\MyASV\hooks\after_prepare\010_add_platform_class.js E:\Apps\ASV\Code\MyASV
add to body class: platform-android
Error: Failed to run "java -version", make sure that you have a JDK installed.
You can get it from: http://www.oracle.com/technetwork/java/javase/downloads.
Your JAVA_HOME is invalid: C:\Program Files\java\jdk1.8.0_77

```

I tried several things over the past hour to fix this. I deinstalled all Java related stuff, reinstalled it, set the JAVA\_HOME several times to the jdk path, added %JAVA\_HOME%\bin to the path-variable, but nothing fixed it. Currently my JAVA\_HOME, which i had to create manually, looks like this at the moment:

`C:\Program Files\Java\jdk1.8.0_77`

Please note that this path is different to the one in the error message. The ‘Java’ is written in lowercase and in uppercase, I don’t know if this is relevant. Also changing this JAVA\_HOME variable and then trying a rebuild gives the same error, the changed variable seems to have no effect on the one ionic uses.

How can I fix this? What exactly is going wrong?

---

<div class="post-metadata">

**Author:** ![Icarus619](https://avatars.discourse-cdn.com/v4/letter/i/3da27b/32.png) [@Icarus619](https://forum.ionicframework.com/u/Icarus619)\
**Post date:** [April 15, 2016, 9:43pm UTC](https://forum.ionicframework.com/t/ionic-build-failed-java-home-is-invalid/49241/2 "2016-04-15T21:43:40Z")

</div>

I solved it by adding the same path to the PATH variable.
