# Logstash -Could not find any executable java binary. Please install java

**URL:** https://discuss.elastic.co/t/logstash-could-not-find-any-executable-java-binary-please-install-java/79774
**Category:** Logstash
**Created:** [March 23, 2017, 4:08pm UTC](https://discuss.elastic.co/t/logstash-could-not-find-any-executable-java-binary-please-install-java/79774 "2017-03-23T16:08:13Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Bob\_Metelsky](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bob_metelsky/32/11387_2.png) [@Bob\_Metelsky](https://discuss.elastic.co/u/Bob_Metelsky)
#### Post date: [March 23, 2017, 4:08pm UTC](https://discuss.elastic.co/t/logstash-could-not-find-any-executable-java-binary-please-install-java/79774/1 "2017-03-23T16:08:14Z")

</div>

Folks - somehow the 5.2 logstash cant find JAVA  
5.2 ES & kibana run fine

```
nn775 ~ :( # rpm -q logstash
logstash-5.2.2-1.noarch

nn775 ~ # /usr/share/logstash/bin/logstash
Could not find any executable java binary. Please install java in your PATH or set JAVA_HOME.

nn775 ~ :( # javac -version
javac 1.8.0_112

nn775 ~ # java -version
java version "1.8.0_112"
Java(TM) SE Runtime Environment (build 1.8.0_112-b15)
Java HotSpot(TM) 64-Bit Server VM (build 25.112-b15, mixed mode)

nn775 ~ # echo $JAVA_HOME
/usr/java/jdk1.8.0_112/jre/bin/java

nn775 ~ # alternatives --config java

There are 4 programs which provide 'java'.

  Selection Command
-----------------------------------------------
   1 /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java
   2 /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/java
   3 /usr/lib/jvm/jre-1.5.0-gcj/bin/java
*+ 4 /usr/java/jdk1.8.0_112/jre/bin/java

```

Any suggestions to get this to work?

---

<div class="post-metadata">

### Author: ![theuntergeek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/theuntergeek/32/44961_2.png) [@theuntergeek](https://discuss.elastic.co/u/theuntergeek)
#### Post date: [March 23, 2017, 8:30pm UTC](https://discuss.elastic.co/t/logstash-could-not-find-any-executable-java-binary-please-install-java/79774/2 "2017-03-23T20:30:53Z")

</div>

This was raised as an [issue](https://github.com/elastic/logstash/issues/6482). It was patched [here](https://github.com/elastic/logstash/pull/6660), and the fix will be in Logstash 5.3.

---

<div class="post-metadata">

### Author: ![Bob\_Metelsky](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bob_metelsky/32/11387_2.png) [@Bob\_Metelsky](https://discuss.elastic.co/u/Bob_Metelsky)
#### Post date: [March 23, 2017, 8:58pm UTC](https://discuss.elastic.co/t/logstash-could-not-find-any-executable-java-binary-please-install-java/79774/3 "2017-03-23T20:58:29Z")

</div>

Thank you, This is redhat 6.5 typically I have system v services but I dont see any service in /etc/init.d/

Also I dont run logstash as a service - I call the executable directly

/opt/logstash/bin/logstash –f /etc/logstash/conf.d/logstash.conf

for upstart  
nn775 /etc/init.d # l /etc/init/log\*  
ls: cannot access /etc/init/log\*: No such file or directory

for services  
nn775 /etc/init.d # l /etc/init.d/log\*  
ls: cannot access /etc/init.d/log\*: No such file or directory

tell me what file to edit I can do that

---

<div class="post-metadata">

### Author: ![theuntergeek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/theuntergeek/32/44961_2.png) [@theuntergeek](https://discuss.elastic.co/u/theuntergeek)
#### Post date: [March 23, 2017, 9:26pm UTC](https://discuss.elastic.co/t/logstash-could-not-find-any-executable-java-binary-please-install-java/79774/4 "2017-03-23T21:26:33Z")

</div>

If you're calling directly...

```auto
JAVA_HOME=/path/to/java_home /opt/logstash/bin/logstash -f /etc/logstash/conf.d/logstash.conf

```

---

<div class="post-metadata">

### Author: ![Bob\_Metelsky](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bob_metelsky/32/11387_2.png) [@Bob\_Metelsky](https://discuss.elastic.co/u/Bob_Metelsky)
#### Post date: [March 23, 2017, 9:45pm UTC](https://discuss.elastic.co/t/logstash-could-not-find-any-executable-java-binary-please-install-java/79774/5 "2017-03-23T21:45:23Z")

</div>

> [@theuntergeek](#):
>
> JAVA\_HOME=/path/to/java\_home /opt/logstash/bin/logstash -f /etc/logstash/conf.d/logstash.conf

Hummm.. interesting enough, I think this may be on my end...

I had JAVA\_HOME wrong

correct JAVA\_HOME is /usr/java/jdk1.8.0\_112

Rather than those listed above

If I set that I have LS in my path and can just call  
logstash -f /etc/logstash/conf.d/logstash.conf

sorry for the the confusion

---

<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: [April 20, 2017, 9:45pm UTC](https://discuss.elastic.co/t/logstash-could-not-find-any-executable-java-binary-please-install-java/79774/6 "2017-04-20T21:45:30Z")

</div>

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