# Elasticsearch plugin-install don't use the proper Java version

**URL:** <https://discuss.elastic.co/t/elasticsearch-plugin-install-dont-use-the-proper-java-version/289269>\
**Category:** Elasticsearch\
**Created:** [November 16, 2021, 7:10am UTC](https://discuss.elastic.co/t/elasticsearch-plugin-install-dont-use-the-proper-java-version/289269 "2021-11-16T07:10:03Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jeremy\_Gachet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jeremy_gachet/32/50275_2.png) [@Jeremy\_Gachet](https://discuss.elastic.co/u/Jeremy_Gachet)\
**Post date:** [November 16, 2021, 7:10am UTC](https://discuss.elastic.co/t/elasticsearch-plugin-install-dont-use-the-proper-java-version/289269/1 "2021-11-16T07:10:03Z")

</div>

Hello,  
I try to install the OpenNlp plugin on my local machine with the command  
`bin/elasticsearch-plugin install https://github.com/spinscale/elasticsearch-ingest-opennlp/releases/download/7.15.2.1/ingest-opennlp-7.15.2.1.zip`

But the commande send the following exception  
`Exception in thread "main" java.lang.IllegalStateException: ingest-opennlp requires Java 17:, your system: 11`

I don't understand why because :

```auto
java --version
java 17.0.1 2021-10-19 LTS
Java(TM) SE Runtime Environment (build 17.0.1+12-LTS-39)
Java HotSpot(TM) 64-Bit Server VM (build 17.0.1+12-LTS-39, mixed mode, sharing)

```

```auto
javac --version
javac 17.0.1

```

```auto
echo $JAVA_HOME
/usr/lib/jvm/java-17-oracle

```

```auto
echo $ES JAVA_HOME
JAVA_HOME

```

And my Elasticsearch node java version is :

```auto
"jvm" : {
        "pid" : 9360,
        "version" : "17.0.1",
        "vm_name" : "Java HotSpot(TM) 64-Bit Server VM",
        "vm_version" : "17.0.1+12-LTS-39",
        "vm_vendor" : "Oracle Corporation",
        "bundled_jdk" : true,
        "using_bundled_jdk" : false,

```

I'm on ubuntu 18.04 and installed Elasticsearch with apt.  
I don't understand which Java the Elasticsearch-plugin binary use.

Thank you in advance for your help

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [November 16, 2021, 2:06pm UTC](https://discuss.elastic.co/t/elasticsearch-plugin-install-dont-use-the-proper-java-version/289269/2 "2021-11-16T14:06:24Z")

</div>

Hey,

thanks for reporting this. I fixed the opennlp plugin to be java11 compatible with the next release, as there are no java 17 features being used.

On your issue: My assumption here is, that running `bin/elasticsearch-plugin` starts a different JVM, than running Elasticsearch as a local service.

Can you try running

```auto
source ./bin/elasticsearch-env
echo $JAVA

```

Thanks!

---

<div class="post-metadata">

**Author:** ![Jeremy\_Gachet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jeremy_gachet/32/50275_2.png) [@Jeremy\_Gachet](https://discuss.elastic.co/u/Jeremy_Gachet)\
**Post date:** [November 17, 2021, 4:45am UTC](https://discuss.elastic.co/t/elasticsearch-plugin-install-dont-use-the-proper-java-version/289269/3 "2021-11-17T04:45:32Z")

</div>

Thank you very much for your quick response.  
unfortunatly the command

`source ./bin/elasticsearch-env`

Just crash my bash

---

<div class="post-metadata">

**Author:** ![Jeremy\_Gachet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jeremy_gachet/32/50275_2.png) [@Jeremy\_Gachet](https://discuss.elastic.co/u/Jeremy_Gachet)\
**Post date:** [November 22, 2021, 12:33pm UTC](https://discuss.elastic.co/t/elasticsearch-plugin-install-dont-use-the-proper-java-version/289269/4 "2021-11-22T12:33:32Z")

</div>

> [@spinscale](#):
>
> `echo $JAVA`

send and empty line.  
How could I force the java version of plugin install ?

---

<div class="post-metadata">

**Author:** ![Jeremy\_Gachet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jeremy_gachet/32/50275_2.png) [@Jeremy\_Gachet](https://discuss.elastic.co/u/Jeremy_Gachet)\
**Post date:** [November 22, 2021, 12:50pm UTC](https://discuss.elastic.co/t/elasticsearch-plugin-install-dont-use-the-proper-java-version/289269/5 "2021-11-22T12:50:28Z")

</div>

Ok that was quite easy but sorry i'm not a java dev

For other people who have a issue like this :

`ES_JAVA_HOME="/usr/lib/jvm/java-17-oracle" ./elasticsearch-plugin install https://github.com/spinscale/elasticsearch-ingest-opennlp/releases/download/7.15.2.1/ingest-opennlp-7.15.2.1.zip`

---

<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:** [December 20, 2021, 12:50pm UTC](https://discuss.elastic.co/t/elasticsearch-plugin-install-dont-use-the-proper-java-version/289269/6 "2021-12-20T12:50:41Z")

</div>

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