# Bug - Elastic search service keeps a cached JAVA\_HOME value -- updating java causes error

**URL:** <https://discuss.elastic.co/t/bug-elastic-search-service-keeps-a-cached-java-home-value-updating-java-causes-error/28961>\
**Category:** Elasticsearch\
**Created:** [September 9, 2015, 7:07pm UTC](https://discuss.elastic.co/t/bug-elastic-search-service-keeps-a-cached-java-home-value-updating-java-causes-error/28961 "2015-09-09T19:07:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sam\_Shteinman](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@Sam\_Shteinman](https://discuss.elastic.co/u/Sam_Shteinman)\
**Post date:** [September 9, 2015, 7:07pm UTC](https://discuss.elastic.co/t/bug-elastic-search-service-keeps-a-cached-java-home-value-updating-java-causes-error/28961/1 "2015-09-09T19:07:39Z")

</div>

EDIT: realized this is in the wrong forum

Hey guys,

Elastic search service keeps a cached JAVA\_HOME value  
Under  
HKEY\_LOCAL\_MACHINE\SOFTWARE\Wow6432Node\Apache Software Foundation\Procrun 2.0\elasticsearch-service-x64\Parameters\Java

There is a Jvm string value which points to for example: C:\Program Files\Java\jdk1.8.0\_45\jre\bin\server\jvm.dll

If you uninstall java u45 and update to a newer java, elastic search service stops working because it has an outdated reference.

We should be pointing to the JAVA\_HOME environment variable so that we can handle the cases of java being updated.

---

<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:** [July 5, 2017, 11:51pm UTC](https://discuss.elastic.co/t/bug-elastic-search-service-keeps-a-cached-java-home-value-updating-java-causes-error/28961/2 "2017-07-05T23:51:29Z")

</div>


