# Unable to use OpenJDK distribution with Elasticsearch

**URL:** <https://discuss.elastic.co/t/unable-to-use-openjdk-distribution-with-elasticsearch/312239>\
**Category:** Elasticsearch\
**Created:** [August 17, 2022, 4:20am UTC](https://discuss.elastic.co/t/unable-to-use-openjdk-distribution-with-elasticsearch/312239 "2022-08-17T04:20:15Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fasil](https://avatars.discourse-cdn.com/v4/letter/f/b38774/32.png) [@Fasil](https://discuss.elastic.co/u/Fasil)\
**Post date:** [August 17, 2022, 4:20am UTC](https://discuss.elastic.co/t/unable-to-use-openjdk-distribution-with-elasticsearch/312239/1 "2022-08-17T04:20:15Z")

</div>

Trying to run elasticsearch-8.3.3-windows-x86\_64 release with OpenJDK 19 Early Access Build 35. But my locally installed OpenJDK 19 is ignored and used bundled Oracle JDK version 18 while starting elasticsearch for the first time. Need to try out some JVM Experimental parameters with elasticsearch. Any suggestions.

 ![Elastic](https://us1.discourse-cdn.com/elastic/original/3X/e/b/eb2845cfefe2c1073b807a3be27abd9ac603a881.jpeg)

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [August 17, 2022, 4:29am UTC](https://discuss.elastic.co/t/unable-to-use-openjdk-distribution-with-elasticsearch/312239/2 "2022-08-17T04:29:34Z")

</div>

Hi @Fasil Welcome to the community.

In the future please don't post images of text, some people can not read them and they can't be searched, copied or debugged.

Did you look at [this](https://www.elastic.co/guide/en/elasticsearch/reference/current/setup.html#jvm-version)

> To use your own version of Java, set the ES\_JAVA\_HOME environment variable. If you must use a version of Java that is different from the bundled JVM, we recommend using a supported LTS version of Java. Elasticsearch will refuse to start if a known-bad version of Java is used. The bundled JVM directory may be removed when using your own JVM

---

<div class="post-metadata">

**Author:** ![Fasil](https://avatars.discourse-cdn.com/v4/letter/f/b38774/32.png) [@Fasil](https://discuss.elastic.co/u/Fasil)\
**Post date:** [August 17, 2022, 4:44am UTC](https://discuss.elastic.co/t/unable-to-use-openjdk-distribution-with-elasticsearch/312239/3 "2022-08-17T04:44:08Z")

</div>

Thank You @stephenb . But the next LTS version is Java 21 in September 2023. Does it mean that in order to try Virtual Threads and Structured Concurrency with Elastic Search, there will be a waiting time of more than one year. Then how come oracle non-LTS JDK 18 version considered?.

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [August 17, 2022, 4:46am UTC](https://discuss.elastic.co/t/unable-to-use-openjdk-distribution-with-elasticsearch/312239/4 "2022-08-17T04:46:02Z")

</div>

Did you try setting `ES_JAVA_HOME` ?

What was the result?

It says we recommend an LTS. I don't believe it's required to start elasticsearch.

Your message above does not look like you set the correct environment variable. Perhaps I'm missing something.

---

<div class="post-metadata">

**Author:** ![Fasil](https://avatars.discourse-cdn.com/v4/letter/f/b38774/32.png) [@Fasil](https://discuss.elastic.co/u/Fasil)\
**Post date:** [August 17, 2022, 5:06am UTC](https://discuss.elastic.co/t/unable-to-use-openjdk-distribution-with-elasticsearch/312239/5 "2022-08-17T05:06:28Z")

</div>

That works @stephenb. 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:** [September 14, 2022, 5:07am UTC](https://discuss.elastic.co/t/unable-to-use-openjdk-distribution-with-elasticsearch/312239/6 "2022-09-14T05:07:22Z")

</div>

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