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

**URL:** <https://discuss.elastic.co/t/bug-elastic-search-service-keeps-a-cached-java-home-value-updating-java-causes-error-elasticsearch/28962>\
**Category:** Elasticsearch\
**Created:** [September 9, 2015, 7:11pm UTC](https://discuss.elastic.co/t/bug-elastic-search-service-keeps-a-cached-java-home-value-updating-java-causes-error-elasticsearch/28962 "2015-09-09T19:11:57Z")\
**Posts on this page:** 5\
**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:11pm UTC](https://discuss.elastic.co/t/bug-elastic-search-service-keeps-a-cached-java-home-value-updating-java-causes-error-elasticsearch/28962/1 "2015-09-09T19:11:57Z")

</div>

Hey guys,

There is an issue with elasticsearch-service if we update Java and we do not reinstall the elasticsearch-service.

In this key:  
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:** ![jasontedor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasontedor/32/66992_2.png) [@jasontedor](https://discuss.elastic.co/u/jasontedor)\
**Post date:** [September 9, 2015, 9:35pm UTC](https://discuss.elastic.co/t/bug-elastic-search-service-keeps-a-cached-java-home-value-updating-java-causes-error-elasticsearch/28962/2 "2015-09-09T21:35:36Z")

</div>

Thank you for bringing this to our attention. Would you mind [filing an issue on GitHub](https://github.com/elastic/elasticsearch/issues) as that's where we track and address issues like this? If not, I'm happy to open the issue for you.

---

<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 11, 2015, 6:07pm UTC](https://discuss.elastic.co/t/bug-elastic-search-service-keeps-a-cached-java-home-value-updating-java-causes-error-elasticsearch/28962/3 "2015-09-11T18:07:51Z")

</div>

> [@jasontedor](#):
>
> Thank you for bringing this to our attention. Would you mind [filing an issue on GitHub](https://github.com/elastic/elasticsearch/issues) as that's where we track and address issues like this? If not, I'm happy to open the issue for you.

No problem! Issue has been filed

---

<div class="post-metadata">

**Author:** ![jasontedor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasontedor/32/66992_2.png) [@jasontedor](https://discuss.elastic.co/u/jasontedor)\
**Post date:** [September 11, 2015, 6:08pm UTC](https://discuss.elastic.co/t/bug-elastic-search-service-keeps-a-cached-java-home-value-updating-java-causes-error-elasticsearch/28962/4 "2015-09-11T18:08:34Z")

</div>

> No problem! Issue has been filed

I see the [issue](https://github.com/elastic/elasticsearch/issues/13521). Thank you!

---

<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:50pm UTC](https://discuss.elastic.co/t/bug-elastic-search-service-keeps-a-cached-java-home-value-updating-java-causes-error-elasticsearch/28962/5 "2017-07-05T23:50:40Z")

</div>


