# JAVA\_HOME issues on ELastic search for Windows Server 2012

**URL:** <https://discuss.elastic.co/t/java-home-issues-on-elastic-search-for-windows-server-2012/79307>\
**Category:** Elasticsearch\
**Created:** [March 20, 2017, 7:03pm UTC](https://discuss.elastic.co/t/java-home-issues-on-elastic-search-for-windows-server-2012/79307 "2017-03-20T19:03:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anshul\_pandey](https://avatars.discourse-cdn.com/v4/letter/a/9dc877/32.png) [@anshul\_pandey](https://discuss.elastic.co/u/anshul_pandey)\
**Post date:** [March 20, 2017, 7:03pm UTC](https://discuss.elastic.co/t/java-home-issues-on-elastic-search-for-windows-server-2012/79307/1 "2017-03-20T19:03:00Z")

</div>

Hi  
I am running into error where elastic search won't start due to JAVA\_HOME not being found. I have installed 64 bit JDK and JRE for windows server 2012 R2. I can see that JAVA\_HOME and PATH are shown correctly. java-help does work in the elasticsearch bin directly without issues

However running elasticSearch bat gives me following error .

**Could not find any executable java binary. Please install java in your PATH or set JAVA\_HOME**

Running Java\_home :  
c:\ElasticStack\elasticsearch-5.2.2\bin\>echo %JAVA\_HOME%  
C:\Program Files\Java\jre1.8.0\_121\bin

Would appreciate any help around this.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 20, 2017, 7:14pm UTC](https://discuss.elastic.co/t/java-home-issues-on-elastic-search-for-windows-server-2012/79307/2 "2017-03-20T19:14:35Z")

</div>

I recommend not using any space in java dirs. Move away from `Program Files`. Might not be your issue though.

---

<div class="post-metadata">

**Author:** ![anshul\_pandey](https://avatars.discourse-cdn.com/v4/letter/a/9dc877/32.png) [@anshul\_pandey](https://discuss.elastic.co/u/anshul_pandey)\
**Post date:** [March 20, 2017, 8:02pm UTC](https://discuss.elastic.co/t/java-home-issues-on-elastic-search-for-windows-server-2012/79307/3 "2017-03-20T20:02:23Z")

</div>

Thanks for the feedback, that resolved the issue, ( uninstalled java, re-installed in directory with no spaces ) and adjusted JAVA\_HOME and PATH variables to reflect to new locations.

---

<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:** [April 17, 2017, 8:02pm UTC](https://discuss.elastic.co/t/java-home-issues-on-elastic-search-for-windows-server-2012/79307/4 "2017-04-17T20:02:29Z")

</div>

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