# Unable to install Logstash 5.0 - Need help

**URL:** <https://discuss.elastic.co/t/unable-to-install-logstash-5-0-need-help/64489>\
**Category:** Logstash\
**Created:** [October 31, 2016, 8:23pm UTC](https://discuss.elastic.co/t/unable-to-install-logstash-5-0-need-help/64489 "2016-10-31T20:23:08Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![VIJAYP](https://avatars.discourse-cdn.com/v4/letter/v/9e8a1a/32.png) [@VIJAYP](https://discuss.elastic.co/u/VIJAYP)\
**Post date:** [October 31, 2016, 8:23pm UTC](https://discuss.elastic.co/t/unable-to-install-logstash-5-0-need-help/64489/1 "2016-10-31T20:23:08Z")

</div>

Hello,

I'm able to install Elasticsearch 5.0 and Kibana 5.0 successfully.

Running on Linux 3.10.0-123.el7.x86\_64.

Installing Logstash 5.0 through YUM following the steps provided in [https://www.elastic.co/guide/en/logstash/5.0/installing-logstash.html](https://www.elastic.co/guide/en/logstash/5.0/installing-logstash.html) and facing issue which says "Could not find any executable java binary. Please install java in your PATH or set JAVA\_HOME"

Verified Java version:

**$ java -version**  
**java version "1.8.0\_101"**  
**Java(TM) SE Runtime Environment (build 1.8.0\_101-b13)**  
**Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)**

Using the following repo config

**[logstash-5.x]**  
**name=Elastic repository for 5.x packages**  
**baseurl=https://artifacts.elastic.co/packages/5.x-prerelease/yum**  
**gpgcheck=0**  
**gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch**  
**enabled=1**  
**autorefresh=1**  
**type=rpm-md**

Installed logstash using sudo yum install logstash

**Downloading packages:**  
**Running transaction check**  
**Running transaction test**  
**Transaction test succeeded**  
**Running transaction**  
\*\* **Installing : 1:logstash-5.0.0-1.noarch** 1/1\*\*  
**Could not find any executable java binary. Please install java in your PATH or set JAVA\_HOME.**  
**warning: %post(logstash-1:5.0.0-1.noarch) scriptlet failed, exit status 1**  
**Non-fatal POSTIN scriptlet failure in rpm package 1:logstash-5.0.0-1.noarch**  
\*\* **Verifying : 1:logstash-5.0.0-1.noarch** 1/1\*\*

**Installed:**  
\*\* **logstash.noarch 1:5.0.0-1**

**Complete!**

I do have JAVA\_HOME configured and PATH as well.

**$echo $JAVA\_HOME**  
**/opt/jdk1.8.0\_101**

**$ echo $PATH**  
**/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/wmsadmin/.local/bin:/home/wmsadmin/bin:/opt/jdk1.8.0\_101/bin:/opt/jdk1.8.0\_101/jre/bin**

Please help how to fix this issue. Already spent much time trying to figure this out .

Appreciate your help.

Regards  
VJ.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [October 31, 2016, 11:00pm UTC](https://discuss.elastic.co/t/unable-to-install-logstash-5-0-need-help/64489/2 "2016-10-31T23:00:07Z")

</div>

> [@VIJAYP](#):
>
> baseurl=[https://artifacts.elastic.co/packages/5.x-prerelease/yum](https://artifacts.elastic.co/packages/5.x-prerelease/yum)

You aren't using the GA version here, you may want to update the URL.

---

<div class="post-metadata">

**Author:** ![VIJAYP](https://avatars.discourse-cdn.com/v4/letter/v/9e8a1a/32.png) [@VIJAYP](https://discuss.elastic.co/u/VIJAYP)\
**Post date:** [November 1, 2016, 2:58am UTC](https://discuss.elastic.co/t/unable-to-install-logstash-5-0-need-help/64489/3 "2016-11-01T02:58:46Z")

</div>

Hi Mark,

Thanks for you reply. Sorry that was a typo. I'm actually using following repo with GA version only:

[logstash-5.x]  
name=Elastic repository for 5.x packages  
baseurl=https://artifacts.elastic.co/packages/5.x/yum  
gpgcheck=0  
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch  
enabled=1  
autorefresh=1  
type=rpm-md

---

<div class="post-metadata">

**Author:** ![VIJAYP](https://avatars.discourse-cdn.com/v4/letter/v/9e8a1a/32.png) [@VIJAYP](https://discuss.elastic.co/u/VIJAYP)\
**Post date:** [November 1, 2016, 5:34pm UTC](https://discuss.elastic.co/t/unable-to-install-logstash-5-0-need-help/64489/4 "2016-11-01T17:34:56Z")

</div>

Hi,

I'm finally able to fix this issue by adding JAVA\_HOME in logstash.lib.sh file:

![](https://us1.discourse-cdn.com/elastic/original/2X/f/f9e70b3e1650e6f1dc2c1492dfe663f4d9c3d6c4.png)

Thank you.  
Vj.

---

<div class="post-metadata">

**Author:** ![chuenl](https://avatars.discourse-cdn.com/v4/letter/c/3e96dc/32.png) [@chuenl](https://discuss.elastic.co/u/chuenl)\
**Post date:** [November 2, 2016, 1:51am UTC](https://discuss.elastic.co/t/unable-to-install-logstash-5-0-need-help/64489/5 "2016-11-02T01:51:16Z")

</div>

You might call this manual editing a fix. But for those of us writing installation script, this is certainly a nightmare.

---

<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:** [November 2, 2016, 4:52am UTC](https://discuss.elastic.co/t/unable-to-install-logstash-5-0-need-help/64489/6 "2016-11-02T04:52:00Z")

</div>

> [@VIJAYP](#):
>
> Could not find any executable java binary.

What this means is that java was not installed for all users using a method like [this one](http://tecadmin.net/install-java-8-on-centos-rhel-and-fedora/) which uses the Oracle JDK RPM, and `alternatives` to make that Java the system default. The root user should automatically have this java as its default, otherwise the post-install script will not be able to find and call java (which it does as part of the setup process).

---

<div class="post-metadata">

**Author:** ![VIJAYP](https://avatars.discourse-cdn.com/v4/letter/v/9e8a1a/32.png) [@VIJAYP](https://discuss.elastic.co/u/VIJAYP)\
**Post date:** [November 3, 2016, 2:35pm UTC](https://discuss.elastic.co/t/unable-to-install-logstash-5-0-need-help/64489/7 "2016-11-03T14:35:41Z")

</div>

Hi,

I followed same method like [this one](http://tecadmin.net/install-java-8-on-centos-rhel-and-fedora/) to setup JDK 8. But for some reason, JAVA\_HOME is flipping to JDK 7 which was installed earlier once I close the terminal and reopen it.

Manually updating [logstash.lib.sh](http://logstash.lib.sh) with JAVA\_HOME might not be a good approach to fix it, but I just wanted to finish the ELK setup.

I might need to do some more research on how to automatically have JDK 8 as default.

Thank you  
VJ.

---

<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:** [November 3, 2016, 3:03pm UTC](https://discuss.elastic.co/t/unable-to-install-logstash-5-0-need-help/64489/8 "2016-11-03T15:03:43Z")

</div>

That's what the `alternatives` command is supposed to do.

---

<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:** [July 6, 2017, 4:31am UTC](https://discuss.elastic.co/t/unable-to-install-logstash-5-0-need-help/64489/9 "2017-07-06T04:31:15Z")

</div>


