# Specify Java version of Enterprise Search

**URL:** <https://discuss.elastic.co/t/specify-java-version-of-enterprise-search/342832>\
**Category:** Elastic Search\
**Tags:** elastic-app-search\
**Created:** [September 12, 2023, 12:31pm UTC](https://discuss.elastic.co/t/specify-java-version-of-enterprise-search/342832 "2023-09-12T12:31:16Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![sebastianboelling](https://avatars.discourse-cdn.com/v4/letter/s/258eb7/32.png) [@sebastianboelling](https://discuss.elastic.co/u/sebastianboelling)\
**Post date:** [September 12, 2023, 12:31pm UTC](https://discuss.elastic.co/t/specify-java-version-of-enterprise-search/342832/1 "2023-09-12T12:31:16Z")

</div>

Hi all,

I have a RHEL 7 VM with Enterprise Search 8.9.2 (Tarball) and Java 1.8. In the documentation [Unterstützungsmatrix | Elastic](https://www.elastic.co/de/support/matrix#matrix_jvm&#enterprise-search-and-jvm) I can read that my Enterprise Search 8.9.2 should support OpenJDK Java 1.8. But When I start with ./bin/enterprise-search I' got the error message that Java 11 is required. So, the documentation may be wrong.

How ever, I can't start my Enterprise Search. Is there a way to run different Java versions on a VM and configure the Java version which is used by Enterprise Search? Due to another on my VM, software which can only use Java 1.8, I have to my plan is to setup Java 11 parallel to 1.8 and let Enterprise Search know, to use Java 11.

Best regards

Sebastian

---

<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:** [September 12, 2023, 12:58pm UTC](https://discuss.elastic.co/t/specify-java-version-of-enterprise-search/342832/2 "2023-09-12T12:58:23Z")

</div>

> So, the documentation may be wrong.

Indeed. That looks wrong as [nobody should be using Java 8 anymore](https://www.oracle.com/fr/java/technologies/javase/javase8-archive-downloads.html).

> **They are not updated with the latest security patches and are not recommended for use in production.**

I'm going to raise an issue internally.

---

<div class="post-metadata">

**Author:** ![Sean\_Story](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sean_story/32/69987_2.png) [@Sean\_Story](https://discuss.elastic.co/u/Sean_Story)\
**Post date:** [September 12, 2023, 3:30pm UTC](https://discuss.elastic.co/t/specify-java-version-of-enterprise-search/342832/3 "2023-09-12T15:30:22Z")

</div>

> Is there a way to run different Java versions on a VM and configure the Java version which is used by Enterprise Search?

@sebastianboelling you can install multiple java versions on your VM and use environment variables (like `JAVA_HOME`) to signal which one an environment should use. For development, our team has also leveraged a tool called [jEnv](https://www.jenv.be/) which can help you manage multiple java installs.

> I can read that my Enterprise Search 8.9.2 should support OpenJDK Java 1.8

David got our team's attention, and we'll work to get that compatibility matrix updated. I will assure you that this is a documentation error, and that only Java 11 is intended to be supported at this time. You can see it listed as a prerequisite in our product documentation: [Run Enterprise Search server using downloads (packages) | Enterprise Search documentation [8.11] | Elastic](https://www.elastic.co/guide/en/enterprise-search/current/installation.html#installation-prerequisites)

---

<div class="post-metadata">

**Author:** ![sebastianboelling](https://avatars.discourse-cdn.com/v4/letter/s/258eb7/32.png) [@sebastianboelling](https://discuss.elastic.co/u/sebastianboelling)\
**Post date:** [September 13, 2023, 12:38pm UTC](https://discuss.elastic.co/t/specify-java-version-of-enterprise-search/342832/4 "2023-09-13T12:38:01Z")

</div>

OK thank you. In which configuration of Enterprise Search file I can (should) set the JAVA\_HOME?

---

<div class="post-metadata">

**Author:** ![Sean\_Story](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sean_story/32/69987_2.png) [@Sean\_Story](https://discuss.elastic.co/u/Sean_Story)\
**Post date:** [September 14, 2023, 7:26pm UTC](https://discuss.elastic.co/t/specify-java-version-of-enterprise-search/342832/5 "2023-09-14T19:26:50Z")

</div>

You can set environment variables in `enterprise-search*/config/env.sh`, or you could set them in whatever script/tool you're using to run `bin/enterprise-search` (might be a Docker entrypoint, a bash script, a service script, etc)

---

<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 12, 2023, 7:27pm UTC](https://discuss.elastic.co/t/specify-java-version-of-enterprise-search/342832/6 "2023-10-12T19:27:20Z")

</div>

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