# Warning: Falling back to java on path. This behavior is deprecated. Specify JAVA\_HOME

**URL:** https://discuss.elastic.co/t/warning-falling-back-to-java-on-path-this-behavior-is-deprecated-specify-java-home/176001
**Category:** Elasticsearch
**Created:** [April 9, 2019, 9:53am UTC](https://discuss.elastic.co/t/warning-falling-back-to-java-on-path-this-behavior-is-deprecated-specify-java-home/176001 "2019-04-09T09:53:36Z")
**Posts on this page:** 19
**Page:** 1

<div class="post-metadata">

### Author: ![sph18](https://avatars.discourse-cdn.com/v4/letter/s/a183cd/32.png) [@sph18](https://discuss.elastic.co/u/sph18)
#### Post date: [April 9, 2019, 9:53am UTC](https://discuss.elastic.co/t/warning-falling-back-to-java-on-path-this-behavior-is-deprecated-specify-java-home/176001/1 "2019-04-09T09:53:36Z")

</div>

Hi all

> ES version: 6.7.1  
> Host: 18.04 LTS  
> openjdk version "1.8.0\_191"  
> OpenJDK Runtime Environment (build 1.8.0\_191-8u191-b12-2ubuntu0.18.04.1-b12)  
> OpenJDK 64-Bit Server VM (build 25.191-b12, mixed mode)

I have this error on two node that I've installed ES on

> warning: Falling back to java on path. This behavior is deprecated. Specify JAVA\_HOME

I'm not sure what is causing the error and how do I specify JAVA\_HOME ?

Thanks

---

<div class="post-metadata">

### Author: ![HenningAndersen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/henningandersen/32/48188_2.png) [@HenningAndersen](https://discuss.elastic.co/u/HenningAndersen)
#### Post date: [April 9, 2019, 11:05am UTC](https://discuss.elastic.co/t/warning-falling-back-to-java-on-path-this-behavior-is-deprecated-specify-java-home/176001/2 "2019-04-09T11:05:18Z")

</div>

Hi @sph18,

I think this is just a warning and that the server should start OK. Relying on PATH to find the java version to use is deprecated in 6.7 and not supported on 7.0. Instead, you should set the JAVA\_HOME environment variable before starting elasticsearch.

If you are starting elasticsearch from a bash commandline, you can specify JAVA\_HOME using:

export JAVA\_HOME=/path/to/java

before starting elasticsearch.

You can also ignore this, but then be aware that on elasticsearch 7.0 you will be switched over to using the bundled java version. I would recommend to set JAVA\_HOME as long as you are on 6.7 and then switch over to not setting it explicitly once upgraded to 7.0.

---

<div class="post-metadata">

### Author: ![sph18](https://avatars.discourse-cdn.com/v4/letter/s/a183cd/32.png) [@sph18](https://discuss.elastic.co/u/sph18)
#### Post date: [April 9, 2019, 3:24pm UTC](https://discuss.elastic.co/t/warning-falling-back-to-java-on-path-this-behavior-is-deprecated-specify-java-home/176001/3 "2019-04-09T15:24:27Z")

</div>

Thanks @HenningAndersen ,

That's makes more seance now. OK brill, thanks 🙂

---

<div class="post-metadata">

### Author: ![manue](https://avatars.discourse-cdn.com/v4/letter/m/f19dbf/32.png) [@manue](https://discuss.elastic.co/u/manue)
#### Post date: [April 10, 2019, 9:58am UTC](https://discuss.elastic.co/t/warning-falling-back-to-java-on-path-this-behavior-is-deprecated-specify-java-home/176001/4 "2019-04-10T09:58:26Z")

</div>

Hi, I have the same problem, but, as you can see in my attached image, I stop the elasticsearch service, I activate it and I look at the status twice (4 seconds apart) and the service goes from active to failed. I do not understand the problem, can you help me please?

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/b/4/b4447fd8f9fe72b81f66d5ba27cdae15699e776e.png)

This is my java path:

![image](https://us1.discourse-cdn.com/elastic/original/3X/8/5/85ef69c335b09579627b3780b45dbe9988321f81.png)

---

<div class="post-metadata">

### Author: ![HenningAndersen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/henningandersen/32/48188_2.png) [@HenningAndersen](https://discuss.elastic.co/u/HenningAndersen)
#### Post date: [April 11, 2019, 6:51am UTC](https://discuss.elastic.co/t/warning-falling-back-to-java-on-path-this-behavior-is-deprecated-specify-java-home/176001/5 "2019-04-11T06:51:40Z")

</div>

Hi @manue,

My best guess is that this is unrelated to the warning. I would advice to check the elasticsearch log files for any error messages.

---

<div class="post-metadata">

### Author: ![manue](https://avatars.discourse-cdn.com/v4/letter/m/f19dbf/32.png) [@manue](https://discuss.elastic.co/u/manue)
#### Post date: [April 11, 2019, 7:02am UTC](https://discuss.elastic.co/t/warning-falling-back-to-java-on-path-this-behavior-is-deprecated-specify-java-home/176001/6 "2019-04-11T07:02:53Z")

</div>

ok, tell me what file do you need to check?

---

<div class="post-metadata">

### Author: ![HenningAndersen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/henningandersen/32/48188_2.png) [@HenningAndersen](https://discuss.elastic.co/u/HenningAndersen)
#### Post date: [April 11, 2019, 10:15am UTC](https://discuss.elastic.co/t/warning-falling-back-to-java-on-path-this-behavior-is-deprecated-specify-java-home/176001/7 "2019-04-11T10:15:40Z")

</div>

Hi @manue,

the primary log file for a debian installation is:

/var/log/elasticsearch/elasticsearch.log

I suspect that could contain relevant information on why the service stops.

---

<div class="post-metadata">

### Author: ![manue](https://avatars.discourse-cdn.com/v4/letter/m/f19dbf/32.png) [@manue](https://discuss.elastic.co/u/manue)
#### Post date: [April 11, 2019, 11:08am UTC](https://discuss.elastic.co/t/warning-falling-back-to-java-on-path-this-behavior-is-deprecated-specify-java-home/176001/8 "2019-04-11T11:08:40Z")

</div>

[2019-04-10T11:57:50,021][INFO][o.e.e.NodeEnvironment] [X302cXZ] using [1] data paths, mounts [[/ (/dev/vda1)]], net usable\_space [73.1gb], net total\_space [77.3gb], types [ext4]  
[2019-04-10T11:57:50,025][INFO][o.e.e.NodeEnvironment] [X302cXZ] heap size [1.9gb], compressed ordinary object pointers [true]  
[2019-04-10T11:57:50,064][INFO][o.e.n.Node] [X302cXZ] node name derived from node ID [X302cXZcRcSosyfZHPXHug]; set [node.name] to override  
[2019-04-10T11:57:50,064][INFO][o.e.n.Node] [X302cXZ] version[6.7.1], pid[5147], build[default/deb/2f32220/2019-04-02T15:59:27.961366Z], OS[Linux/4.15.0-47-generic/amd64], JVM[Oracle Corporation/Java HotSpot(TM) 64-Bit Server VM/1.8.0\_201/25.201-b09]  
[2019-04-10T11:57:50,064][INFO][o.e.n.Node] [X302cXZ] JVM arguments [-Xms2g, -Xmx2g, -XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOccupancyOnly, -Des.networkaddress.cache.ttl=60, -Des.networkaddress.cache.negative.ttl=10, -XX:+AlwaysPreTouch, -Xss1m, -Djava.awt.headless=true, -Dfile.encoding=UTF-8, -Djna.nosys=true, -XX:-OmitStackTraceInFastThrow, -Dio.netty.noUnsafe=true, -Dio.netty.noKeySetOptimization=true, -Dio.netty.recycler.maxCapacityPerThread=0, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -Djava.io.tmpdir=/tmp/elasticsearch-1003868106751122367, -XX:+HeapDumpOnOutOfMemoryError, -XX:HeapDumpPath=/var/lib/elasticsearch, -XX:ErrorFile=/var/log/elasticsearch/hs\_err\_pid%p.log, -XX:+PrintGCDetails, -XX:+PrintGCDateStamps, -XX:+PrintTenuringDistribution, -XX:+PrintGCApplicationStoppedTime, -Xloggc:/var/log/elasticsearch/gc.log, -XX:+UseGCLogFileRotation, -XX:NumberOfGCLogFiles=32, -XX:GCLogFileSize=64m, -Des.path.home=/usr/share/elasticsearch, -Des.path.conf=/etc/elasticsearch, -Des.distribution.flavor=default, -Des.distribution.type=deb]  
[2019-04-10T11:57:51,792][ERROR][o.e.b.Bootstrap] [X302cXZ] Exception  
java.lang.IllegalArgumentException: Plugin [analysis-phonetic] was built for Elasticsearch version 6.7.0 but version 6.7.1 is running  
at org.elasticsearch.plugins.PluginsService.verifyCompatibility(PluginsService.java:346) ~[elasticsearch-6.7.1.jar:6.7.1]  
at org.elasticsearch.plugins.PluginsService.loadBundle(PluginsService.java:531) ~[elasticsearch-6.7.1.jar:6.7.1]  
at org.elasticsearch.plugins.PluginsService.loadBundles(PluginsService.java:471) ~[elasticsearch-6.7.1.jar:6.7.1]  
at org.elasticsearch.plugins.PluginsService.(PluginsService.java:163) ~[elasticsearch-6.7.1.jar:6.7.1]  
at org.elasticsearch.node.Node.(Node.java:339) ~[elasticsearch-6.7.1.jar:6.7.1]  
at org.elasticsearch.node.Node.(Node.java:266) ~[elasticsearch-6.7.1.jar:6.7.1]  
at org.elasticsearch.bootstrap.Bootstrap$5.(Bootstrap.java:212) ~[elasticsearch-6.7.1.jar:6.7.1]  
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:212) ~[elasticsearch-6.7.1.jar:6.7.1]  
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:333) [elasticsearch-6.7.1.jar:6.7.1]  
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159) [elasticsearch-6.7.1.jar:6.7.1]  
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:150) [elasticsearch-6.7.1.jar:6.7.1]  
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) [elasticsearch-6.7.1.jar:6.7.1]  
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124) [elasticsearch-cli-6.7.1.jar:6.7.1]  
at org.elasticsearch.cli.Command.main(Command.java:90) [elasticsearch-cli-6.7.1.jar:6.7.1]  
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:116) [elasticsearch-6.7.1.jar:6.7.1]  
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:93) [elasticsearch-6.7.1.jar:6.7.1]  
[2019-04-10T11:57:51,798][WARN][o.e.b.ElasticsearchUncaughtExceptionHandler] [X302cXZ] uncaught exception in thread [main]  
org.elasticsearch.bootstrap.StartupException: java.lang.IllegalArgumentException: Plugin [analysis-phonetic] was built for Elasticsearch version 6.7.0 but version 6.7.1 is running  
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:163) ~[elasticsearch-6.7.1.jar:6.7.1]  
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:150) ~[elasticsearch-6.7.1.jar:6.7.1]  
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) ~[elasticsearch-6.7.1.jar:6.7.1]  
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124) ~[elasticsearch-cli-6.7.1.jar:6.7.1]  
at org.elasticsearch.cli.Command.main(Command.java:90) ~[elasticsearch-cli-6.7.1.jar:6.7.1]  
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:116) ~[elasticsearch-6.7.1.jar:6.7.1]  
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:93) ~[elasticsearch-6.7.1.jar:6.7.1]  
Caused by: java.lang.IllegalArgumentException: Plugin [analysis-phonetic] was built for Elasticsearch version 6.7.0 but version 6.7.1 is running  
at org.elasticsearch.plugins.PluginsService.verifyCompatibility(PluginsService.java:346) ~[elasticsearch-6.7.1.jar:6.7.1]  
at org.elasticsearch.plugins.PluginsService.loadBundle(PluginsService.java:531) ~[elasticsearch-6.7.1.jar:6.7.1]  
at org.elasticsearch.plugins.PluginsService.loadBundles(PluginsService.java:471) ~[elasticsearch-6.7.1.jar:6.7.1]  
at org.elasticsearch.plugins.PluginsService.(PluginsService.java:163) ~[elasticsearch-6.7.1.jar:6.7.1]  
at org.elasticsearch.node.Node.(Node.java:339) ~[elasticsearch-6.7.1.jar:6.7.1]  
at org.elasticsearch.node.Node.(Node.java:266) ~[elasticsearch-6.7.1.jar:6.7.1]  
at org.elasticsearch.bootstrap.Bootstrap$5.(Bootstrap.java:212) ~[elasticsearch-6.7.1.jar:6.7.1]  
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:212) ~[elasticsearch-6.7.1.jar:6.7.1]  
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:333) ~[elasticsearch-6.7.1.jar:6.7.1]  
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159) ~[elasticsearch-6.7.1.jar:6.7.1]  
... 6 more

---

<div class="post-metadata">

### Author: ![manue](https://avatars.discourse-cdn.com/v4/letter/m/f19dbf/32.png) [@manue](https://discuss.elastic.co/u/manue)
#### Post date: [April 11, 2019, 11:10am UTC](https://discuss.elastic.co/t/warning-falling-back-to-java-on-path-this-behavior-is-deprecated-specify-java-home/176001/9 "2019-04-11T11:10:02Z")

</div>

This is the information I have in this log file, is it enough for you? Can you see any error?

---

<div class="post-metadata">

### Author: ![HenningAndersen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/henningandersen/32/48188_2.png) [@HenningAndersen](https://discuss.elastic.co/u/HenningAndersen)
#### Post date: [April 11, 2019, 11:26am UTC](https://discuss.elastic.co/t/warning-falling-back-to-java-on-path-this-behavior-is-deprecated-specify-java-home/176001/10 "2019-04-11T11:26:46Z")

</div>

Hi @manue,

yes, the log does show that:

```auto
org.elasticsearch.bootstrap.StartupException: java.lang.IllegalArgumentException: Plugin [analysis-phonetic] was built for Elasticsearch version 6.7.0 but version 6.7.1 is running

```

After the upgrade to 6.7.1, you will also have to upgrade that plugin. See:

[https://www.elastic.co/guide/en/elasticsearch/plugins/6.7/analysis-phonetic.html](https://www.elastic.co/guide/en/elasticsearch/plugins/6.7/analysis-phonetic.html)

for instructions. Notice that to upgrade it you have to uninstall it first. If you no longer need the plugin, simply leave it uninstalled.

---

<div class="post-metadata">

### Author: ![manue](https://avatars.discourse-cdn.com/v4/letter/m/f19dbf/32.png) [@manue](https://discuss.elastic.co/u/manue)
#### Post date: [April 11, 2019, 11:36am UTC](https://discuss.elastic.co/t/warning-falling-back-to-java-on-path-this-behavior-is-deprecated-specify-java-home/176001/11 "2019-04-11T11:36:01Z")

</div>

Thank you very much for your help! So, I just have to uninstall it? I do not know if that plugin works with Magento or is not necessary? what do you recommend? uninstall it and reinstall it or just uninstall it?

---

<div class="post-metadata">

### Author: ![HenningAndersen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/henningandersen/32/48188_2.png) [@HenningAndersen](https://discuss.elastic.co/u/HenningAndersen)
#### Post date: [April 11, 2019, 11:40am UTC](https://discuss.elastic.co/t/warning-falling-back-to-java-on-path-this-behavior-is-deprecated-specify-java-home/176001/12 "2019-04-11T11:40:23Z")

</div>

Hi @manue,

I do not know Magento and would advice to direct your question to the maintainers of Magento.

Given that uncertainty, it seems safest to reinstall it unless they can clarify that it is not needed.

---

<div class="post-metadata">

### Author: ![manue](https://avatars.discourse-cdn.com/v4/letter/m/f19dbf/32.png) [@manue](https://discuss.elastic.co/u/manue)
#### Post date: [April 11, 2019, 11:45am UTC](https://discuss.elastic.co/t/warning-falling-back-to-java-on-path-this-behavior-is-deprecated-specify-java-home/176001/13 "2019-04-11T11:45:45Z")

</div>

Ok Thank you! And for this warning? What do you think? How can I solve that?

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/5/d/5d6ed748e6fe5c0da9299b54c13f1dc8ceb8086a.png)

---

<div class="post-metadata">

### Author: ![HenningAndersen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/henningandersen/32/48188_2.png) [@HenningAndersen](https://discuss.elastic.co/u/HenningAndersen)
#### Post date: [April 11, 2019, 12:29pm UTC](https://discuss.elastic.co/t/warning-falling-back-to-java-on-path-this-behavior-is-deprecated-specify-java-home/176001/14 "2019-04-11T12:29:00Z")

</div>

Hi @manue,

you can setup JAVA\_HOME in `/etc/default/elasticsearch` (debian based). Something like this worked on my setup:

```auto
JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64/

```

but the actual path may vary depending on installation location and version of java.

See following for more info:

[https://www.elastic.co/guide/en/elasticsearch/reference/6.7/setting-system-settings.html](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/setting-system-settings.html)

---

<div class="post-metadata">

### Author: ![manue](https://avatars.discourse-cdn.com/v4/letter/m/f19dbf/32.png) [@manue](https://discuss.elastic.co/u/manue)
#### Post date: [April 11, 2019, 12:29pm UTC](https://discuss.elastic.co/t/warning-falling-back-to-java-on-path-this-behavior-is-deprecated-specify-java-home/176001/15 "2019-04-11T12:29:51Z")

</div>

Now everything works fine, but checking the log I find the last row of the attached image, what do you think about this? It is normal? (Finally I uninstalled the plugin and reinstalled it)

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/7/a/7a766c0582a43ca315da6401e2938b494c8261fe.png)

---

<div class="post-metadata">

### Author: ![manue](https://avatars.discourse-cdn.com/v4/letter/m/f19dbf/32.png) [@manue](https://discuss.elastic.co/u/manue)
#### Post date: [April 11, 2019, 12:38pm UTC](https://discuss.elastic.co/t/warning-falling-back-to-java-on-path-this-behavior-is-deprecated-specify-java-home/176001/16 "2019-04-11T12:38:21Z")

</div>

> [@HenningAndersen](#):
>
> /etc/default/elasticsearch

Thank you so much! this problem was fixed! 🙂

Can you tell me something about the problem of the previous picture? It is a problem? important? Can I solve it in any way? Thank you so much!

---

<div class="post-metadata">

### Author: ![HenningAndersen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/henningandersen/32/48188_2.png) [@HenningAndersen](https://discuss.elastic.co/u/HenningAndersen)
#### Post date: [April 11, 2019, 12:53pm UTC](https://discuss.elastic.co/t/warning-falling-back-to-java-on-path-this-behavior-is-deprecated-specify-java-home/176001/17 "2019-04-11T12:53:14Z")

</div>

Hi @manue,

the last line shows that the cluster recovered all indices fine after the restart and the status is now GREEN meaning everything is good.

See following for more information on the definition of RED, YELLOW and GREEN cluster health and how to get more detailed information:

[https://www.elastic.co/guide/en/elasticsearch/reference/6.7/cluster-health.html](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/cluster-health.html)

---

<div class="post-metadata">

### Author: ![manue](https://avatars.discourse-cdn.com/v4/letter/m/f19dbf/32.png) [@manue](https://discuss.elastic.co/u/manue)
#### Post date: [April 11, 2019, 1:02pm UTC](https://discuss.elastic.co/t/warning-falling-back-to-java-on-path-this-behavior-is-deprecated-specify-java-home/176001/18 "2019-04-11T13:02:55Z")

</div>

Thank you so much for all! 🙂

---

<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: [May 9, 2019, 1:02pm UTC](https://discuss.elastic.co/t/warning-falling-back-to-java-on-path-this-behavior-is-deprecated-specify-java-home/176001/19 "2019-05-09T13:02:59Z")

</div>

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