# Could not find java; set JAVA\_HOME or ensure java is in PATH

**URL:** <https://discuss.elastic.co/t/could-not-find-java-set-java-home-or-ensure-java-is-in-path/158646>\
**Category:** Elasticsearch\
**Created:** [November 28, 2018, 8:06pm UTC](https://discuss.elastic.co/t/could-not-find-java-set-java-home-or-ensure-java-is-in-path/158646 "2018-11-28T20:06:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hiteshsharma](https://avatars.discourse-cdn.com/v4/letter/h/35a633/32.png) [@hiteshsharma](https://discuss.elastic.co/u/hiteshsharma)\
**Post date:** [November 28, 2018, 8:06pm UTC](https://discuss.elastic.co/t/could-not-find-java-set-java-home-or-ensure-java-is-in-path/158646/1 "2018-11-28T20:06:58Z")

</div>

The Elastic search stopped working on my system all of a sudden. I was throwing out an error  
"could not find java; set JAVA\_HOME or ensure java is in PATH"

I have JAVA\_HOME set to "C:\Program Files\Java\jdk11.0.1" yet its not able to find out.  
My elastic version is 6.5

---

<div class="post-metadata">

**Author:** ![Kicker83](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kicker83/32/121202_2.png) [@Kicker83](https://discuss.elastic.co/u/Kicker83)\
**Post date:** [December 4, 2018, 3:45pm UTC](https://discuss.elastic.co/t/could-not-find-java-set-java-home-or-ensure-java-is-in-path/158646/2 "2018-12-04T15:45:58Z")

</div>

Same problem here. I upgraded from 6.3.2 to 6.5 (ubuntu 16.04), and I get this error:

elasticsearch[567]: could not find java; set JAVA\_HOME or ensure java is in PATH

---

<div class="post-metadata">

**Author:** ![hiteshsharma](https://avatars.discourse-cdn.com/v4/letter/h/35a633/32.png) [@hiteshsharma](https://discuss.elastic.co/u/hiteshsharma)\
**Post date:** [December 4, 2018, 4:16pm UTC](https://discuss.elastic.co/t/could-not-find-java-set-java-home-or-ensure-java-is-in-path/158646/3 "2018-12-04T16:16:31Z")

</div>

My research so far suggests that this error is for individual reasons. For me, it turned out a permission issue. My Elasticsearch was in d drive and java was in c. I downloaded .zip of jdk and uncompressed in d drive and set the environment variable to point that location. This solved my problem. You can also check that by running below in command prompt, if you see the same error, probably you too having same reason

> java version

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [January 1, 2019, 4:16pm UTC](https://discuss.elastic.co/t/could-not-find-java-set-java-home-or-ensure-java-is-in-path/158646/4 "2019-01-01T16:16:44Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
