# Java Upgrade doesn't stop elasticsearch. Why?

**URL:** <https://discuss.elastic.co/t/java-upgrade-doesnt-stop-elasticsearch-why/314179>\
**Category:** Elasticsearch\
**Created:** [September 12, 2022, 10:06am UTC](https://discuss.elastic.co/t/java-upgrade-doesnt-stop-elasticsearch-why/314179 "2022-09-12T10:06:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Divit\_Sharma](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/divit_sharma/32/32348_2.png) [@Divit\_Sharma](https://discuss.elastic.co/u/Divit_Sharma)\
**Post date:** [September 12, 2022, 10:06am UTC](https://discuss.elastic.co/t/java-upgrade-doesnt-stop-elasticsearch-why/314179/1 "2022-09-12T10:06:05Z")

</div>

I am using external JDK on Oracle Linux 7.9. Elasticsearch service is up and running when I upgrade the java. Also, there are no entries in log. I am not sure about this behavior.

Elasticsearch uses `ES_JAVA_HOME=/usr/bin/java` but it points to new directory after update ie. `/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.342.b07-1.el7_9.x86_64/jre/bin/java` and before it was `/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.322.b06-1.el7_9.x86_64/jre/bin/java`.

Can anyone explain? I expect elasticsearch to interrupt since after upgrade the older path doesn't exist.

```auto
ls -lrt /usr/bin/java
lrwxrwxrwx. 1 root root 22 Sep 12 05:43 /usr/bin/java -> /etc/alternatives/java

ls -lrt /etc/alternatives/java
lrwxrwxrwx. 1 root root 73 Sep 12 05:43 /etc/alternatives/java -> /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.322.b06-1.el7_9.x86_64/jre/bin/java

# After upgrade
ls -lrt /etc/alternatives/java
lrwxrwxrwx. 1 root root 73 Sep 12 05:43 /etc/alternatives/java -> /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.342.b07-1.el7_9.x86_64/jre/bin/java

```

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [September 12, 2022, 10:13am UTC](https://discuss.elastic.co/t/java-upgrade-doesnt-stop-elasticsearch-why/314179/2 "2022-09-12T10:13:19Z")

</div>

> [@Divit\_Sharma](#):
>
> I expect elasticsearch to interrupt since after upgrade the older path doesn't exist.

But it'll have the things it needs to run in memory (via the OS). You need to restart it if you want it to use the new one.

---

<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:** [October 10, 2022, 10:16am UTC](https://discuss.elastic.co/t/java-upgrade-doesnt-stop-elasticsearch-why/314179/4 "2022-10-10T10:16:13Z")

</div>

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