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 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.
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.