# Logstash not using bundled JDK

**URL:** <https://discuss.elastic.co/t/logstash-not-using-bundled-jdk/266814>\
**Category:** Logstash\
**Created:** [March 10, 2021, 1:41pm UTC](https://discuss.elastic.co/t/logstash-not-using-bundled-jdk/266814 "2021-03-10T13:41:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daniel\_Carmel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/daniel_carmel/32/64365_2.png) [@Daniel\_Carmel](https://discuss.elastic.co/u/Daniel_Carmel)\
**Post date:** [March 10, 2021, 1:41pm UTC](https://discuss.elastic.co/t/logstash-not-using-bundled-jdk/266814/1 "2021-03-10T13:41:04Z")

</div>

Hey Elastic team,  
im using logstash 7.11.0 and ubuntu 14.04  
Whenever i run it manually like this

```auto
sudo /usr/share/logstash/bin/logstash --path.settings /etc/logstash

```

logstash running as expected and using bundled JDK, but when i try to run the same command using supervisor service it fails with error message `Using JAVA_HOME defined java: /usr/lib/jvm/default-java`

The supervisor service file looks like this:

```auto
[program:logstash-client]
command = /usr/share/logstash/bin/logstash --path.settings /etc/logstash
process_name = %(program_name)s
directory = /etc/logstash
autostart = true
autorestart = true
user = root
stdout_logfile_maxbytes = 1MB
stdout_logfile_backups = 0
stderr_logfile_maxbytes = 1MB
stderr_logfile_backups = 0

```

What can cause this kind of behaviour and how can i overcome it?  
Is there any other way to make logstash use bundled JDK and keep JAVA\_HOME set?

Thanks in advance

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [March 10, 2021, 3:47pm UTC](https://discuss.elastic.co/t/logstash-not-using-bundled-jdk/266814/2 "2021-03-10T15:47:59Z")

</div>

> [@Daniel\_Carmel](#):
>
> Is there any other way to make logstash use bundled JDK and keep JAVA\_HOME set?

You tell logstash to use an unbundled JDK by setting JAVA\_HOME. If, for some reasons, you want to have JAVA\_HOME set _and_ use the bundled JDK you would have to locate the bundled JDK and point JAVA\_HOME at it.

---

<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 7, 2021, 3:48pm UTC](https://discuss.elastic.co/t/logstash-not-using-bundled-jdk/266814/3 "2021-04-07T15:48:30Z")

</div>

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