# Installing logstash 6.7 with OpenJDK-11

**URL:** <https://discuss.elastic.co/t/installing-logstash-6-7-with-openjdk-11/177771>\
**Category:** Logstash\
**Created:** [April 21, 2019, 6:34pm UTC](https://discuss.elastic.co/t/installing-logstash-6-7-with-openjdk-11/177771 "2019-04-21T18:34:45Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![epacke](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/epacke/32/40517_2.png) [@epacke](https://discuss.elastic.co/u/epacke)\
**Post date:** [April 21, 2019, 6:34pm UTC](https://discuss.elastic.co/t/installing-logstash-6-7-with-openjdk-11/177771/1 "2019-04-21T18:34:45Z")

</div>

Hi there  
Now that Oracle has decided to make the Java installation more troublesome I decided to try Openjdk instead. It says on the Elastic support matrix that both ElasticSearch and Logstash supports Openjdk-11.

However, when attempting to install logstash using **[https://artifacts.elastic.co/packages/6.x/apt](https://artifacts.elastic.co/packages/6.x/apt) stable main** it crashes for me.

```
sudo apt-get install logstash
Reading package lists... Done
Building dependency tree
Reading state information... Done
logstash is already the newest version (1:6.7.1-1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up logstash (1:6.7.1-1) ...
Using provided startup.options file: /etc/logstash/startup.options
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.jruby.util.SecurityHelper to field java.lang.reflect.Field.modifiers
WARNING: Please consider reporting this to the maintainers of org.jruby.util.SecurityHelper
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Errno::EBADF: Bad file descriptor - systemctl
            spawn at org/jruby/RubyProcess.java:1567
            spawn at org/jruby/RubyKernel.java:1632
        popen_run at /usr/share/logstash/vendor/jruby/lib/ruby/stdlib/open3.rb:206
           popen3 at /usr/share/logstash/vendor/jruby/lib/ruby/stdlib/open3.rb:102
          execute at /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/pleaserun-0.0.30/lib/pleaserun/detector.rb:74
   detect_systemd at /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/pleaserun-0.0.30/lib/pleaserun/detector.rb:29
  detect_platform at /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/pleaserun-0.0.30/lib/pleaserun/detector.rb:24
           detect at /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/pleaserun-0.0.30/lib/pleaserun/detector.rb:18
   setup_defaults at /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/pleaserun-0.0.30/lib/pleaserun/cli.rb:153
          execute at /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/pleaserun-0.0.30/lib/pleaserun/cli.rb:119
              run at /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/clamp-0.6.5/lib/clamp/command.rb:67
              run at /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/pleaserun-0.0.30/lib/pleaserun/cli.rb:114
              run at /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/clamp-0.6.5/lib/clamp/command.rb:132
           <main> at /usr/share/logstash/lib/systeminstall/pleasewrap.rb:12
Unable to install system startup script for Logstash.
chmod: cannot access '/etc/default/logstash': No such file or directory
dpkg: error processing package logstash (--configure):
 installed logstash package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 logstash
E: Sub-process /usr/bin/dpkg returned an error code (1)

```

Poked around a bit on the forums and found something about JAVA\_HOME not being set.

```
export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
echo $JAVA_HOME
/usr/lib/jvm/java-11-openjdk-amd64

```

Adding it to the path too and testing it:

```
export PATH=$PATH:$JAVA_HOME/bin
java --version
openjdk 11.0.3 2019-04-16
OpenJDK Runtime Environment (build 11.0.3+7-Ubuntu-1ubuntu1)
OpenJDK 64-Bit Server VM (build 11.0.3+7-Ubuntu-1ubuntu1, mixed mode, sharing)

```

**But it still fails with the same error message.**

Running on:

```
lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 19.04
Release: 19.04
Codename: disco

```

What am I missing? I can't be the only one running into this but yet I can find so little information about it.

Kind regards,  
Patrik

---

<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:** [April 21, 2019, 6:49pm UTC](https://discuss.elastic.co/t/installing-logstash-6-7-with-openjdk-11/177771/2 "2019-04-21T18:49:51Z")

</div>

> [@epacke](#):
>
> illegal reflective access

A search for that in the forum would find you [this](https://discuss.elastic.co/t/logstash-v-7-0-rc-2-installation-with-java-11-fails/175473/2) post.

---

<div class="post-metadata">

**Author:** ![epacke](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/epacke/32/40517_2.png) [@epacke](https://discuss.elastic.co/u/epacke)\
**Post date:** [April 21, 2019, 8:14pm UTC](https://discuss.elastic.co/t/installing-logstash-6-7-with-openjdk-11/177771/3 "2019-04-21T20:14:13Z")

</div>

Hi Badger  
Thank you for your answer. I don't see any option to use Openjdk version 8 anywhere, neither in the Elastic compatibility matrix, nor even an option to install it in Ubuntu.

If you are referring to Oracle v8 I understand. But I rather avoid using that version given the recent development with the license and installation options.

Kind regards,  
Patrik

---

<div class="post-metadata">

**Author:** ![epacke](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/epacke/32/40517_2.png) [@epacke](https://discuss.elastic.co/u/epacke)\
**Post date:** [April 22, 2019, 8:46am UTC](https://discuss.elastic.co/t/installing-logstash-6-7-with-openjdk-11/177771/4 "2019-04-22T08:46:20Z")

</div>

I guess you did refer to openjdk-8 after all. I looked at it and it's not available on Ubuntu 19.04:

> <https://askubuntu.com/questions/1135045/how-to-install-the-openjdk-8-ubuntu-19-04>

Looking at the matrix though it should be compatible with openjdk-11:  
[https://www.elastic.co/support/matrix#matrix\_jvm](https://www.elastic.co/support/matrix#matrix_jvm)

Guess I am forced to use another version of Ubuntu.

Kind regards,  
Patrik

---

<div class="post-metadata">

**Author:** ![epacke](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/epacke/32/40517_2.png) [@epacke](https://discuss.elastic.co/u/epacke)\
**Post date:** [April 23, 2019, 5:18pm UTC](https://discuss.elastic.co/t/installing-logstash-6-7-with-openjdk-11/177771/5 "2019-04-23T17:18:54Z")

</div>

If anyone else finds a resolution to this I'd be grateful for any information.

Kind regards,  
Patrik

---

<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 21, 2019, 5:27pm UTC](https://discuss.elastic.co/t/installing-logstash-6-7-with-openjdk-11/177771/6 "2019-05-21T17:27:02Z")

</div>

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