# Not find java in JAVA\_HOME or bundled for elasticsearch

**URL:** <https://discuss.elastic.co/t/not-find-java-in-java-home-or-bundled-for-elasticsearch/208779>\
**Category:** Elasticsearch\
**Created:** [November 20, 2019, 9:19pm UTC](https://discuss.elastic.co/t/not-find-java-in-java-home-or-bundled-for-elasticsearch/208779 "2019-11-20T21:19:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mehak\_Bhargava](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mehak_bhargava/32/54750_2.png) [@Mehak\_Bhargava](https://discuss.elastic.co/u/Mehak_Bhargava)\
**Post date:** [November 20, 2019, 9:19pm UTC](https://discuss.elastic.co/t/not-find-java-in-java-home-or-bundled-for-elasticsearch/208779/1 "2019-11-20T21:19:39Z")

</div>

```auto
D:\ESQELK\elasticsearch-7.2.0-windows-x86_64\elasticsearch-7.2.0\bin>elasticsearch
"could not find java in JAVA_HOME or bundled at D:\ESQELK\elasticsearch-7.2.0-windows-x86_64\elasticsearch-7.2.0\jdk"

```

and JAVA\_HOME is set to C:\Users\mehak\Documents\java-1.8.0-openjdk-1.8.0.232-3.b09.redhat.windows.x86\_64

What is the issue. please help!

---

<div class="post-metadata">

**Author:** ![forloop](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/forloop/32/9021_2.png) [@forloop](https://discuss.elastic.co/u/forloop)\
**Post date:** [November 24, 2019, 11:27pm UTC](https://discuss.elastic.co/t/not-find-java-in-java-home-or-bundled-for-elasticsearch/208779/2 "2019-11-24T23:27:46Z")

</div>

> [@Mehak\_Bhargava](#):
>
> C:\Users\mehak\Documents\java-1.8.0-openjdk-1.8.0.232-3.b09.redhat.windows.x86\_64

Does this directory contain a `bin` directory in which `java.exe` can be found? I _think_ that's what the process ultimately looks for

---

<div class="post-metadata">

**Author:** ![Mehak\_Bhargava](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mehak_bhargava/32/54750_2.png) [@Mehak\_Bhargava](https://discuss.elastic.co/u/Mehak_Bhargava)\
**Post date:** [December 16, 2019, 7:12pm UTC](https://discuss.elastic.co/t/not-find-java-in-java-home-or-bundled-for-elasticsearch/208779/3 "2019-12-16T19:12:14Z")

</div>

Yes, java.exe can be found in C:\Users\mehak\Documents\java-1.8.0-openjdk-1.8.0.232-3.b09.redhat.windows.x86\_64\java-1.8.0-openjdk-1.8.0.232-3.b09.redhat.windowsx86\_64\bin

I think it is definitely a java issue because of which elasticsearch isnt running. What should be my next approach?

---

<div class="post-metadata">

**Author:** ![forloop](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/forloop/32/9021_2.png) [@forloop](https://discuss.elastic.co/u/forloop)\
**Post date:** [December 17, 2019, 2:00am UTC](https://discuss.elastic.co/t/not-find-java-in-java-home-or-bundled-for-elasticsearch/208779/4 "2019-12-17T02:00:55Z")

</div>

> [@Mehak\_Bhargava](#):
>
> C:\Users\mehak\Documents\java-1.8.0-openjdk-1.8.0.232-3.b09.redhat.windows.x86\_64\java-1.8.0-openjdk-1.8.0.232-3.b09.redhat.windowsx86\_64\bin

This has an extra directory, `java-1.8.0-openjdk-1.8.0.232-3.b09.redhat.windowsx86_64`, in which the `bin` directory is found. In light of this, I think `JAVA_HOME` should be set to

```auto
C:\Users\mehak\Documents\java-1.8.0-openjdk-1.8.0.232-3.b09.redhat.windows.x86_64\java-1.8.0-openjdk-1.8.0.232-3.b09.redhat.windowsx86_64

```

For example, with PowerShell

```ps
[Environment]::SetEnvironmentVariable("JAVA_HOME", "C:\Users\mehak\Documents\java-1.8.0-openjdk-1.8 .0.232-3.b09.redhat.windows.x86_64\java-1.8.0-openjdk-1.8.0.232-3.b09.redhat.windowsx86_64", "Machine")

```

Then open a new session, and start Elasticsearch.

---

<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 14, 2020, 2:00am UTC](https://discuss.elastic.co/t/not-find-java-in-java-home-or-bundled-for-elasticsearch/208779/5 "2020-01-14T02:00:57Z")

</div>

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