Version error with both Java 7 and 8

Unsupported major.minor version 52.0

  • after installing logstash: yum install logstash (from repo 'https://artifacts.elastic.co/GPG-KEY-elasticsearch')
  • installing java 8
  • edit startup options: JAVACMD="${JAVA8_HOME}/bin/java"
  • /usr/share/logstash/bin/system-install -> Successfully created system startup script for Logstash
  • start logstash -> logstash start/running, process 19412
  • ps ax |grep logstash -> 20085 ? SNsl 0:26 /usr/bin/java ...
  • /usr/share/logstash/bin/logstash -e 'input { stdin { } } output { stdout {} }'

Output:

LoadError: JRuby ext built for wrong Java version in `com.purbon.jrmonitor.JRMonitorService': java.lang.UnsupportedClassVersionError: com/purbon/jrmonitor/JRMonitorService : Unsupported major.minor version 52.0
  require at org/jruby/RubyKernel.java:1040
   (root) at /usr/share/logstash/vendor/bundle/jruby/1.9/gems/jrmonitor-0.4.2/lib/jrmonitor.rb:4
  require at org/jruby/RubyKernel.java:1040
   (root) at /usr/share/logstash/logstash-core/lib/logstash/instrument/periodic_poller/jvm.rb:1
  require at org/jruby/RubyKernel.java:1040
   (root) at /usr/share/logstash/logstash-core/lib/logstash/instrument/periodic_poller/jvm.rb:5
  require at org/jruby/RubyKernel.java:1040
   (root) at /usr/share/logstash/logstash-core/lib/logstash/instrument/periodic_pollers.rb:1
  require at org/jruby/RubyKernel.java:1040
   (root) at /usr/share/logstash/logstash-core/lib/logstash/instrument/periodic_pollers.rb:3
  require at org/jruby/RubyKernel.java:1040
   (root) at /usr/share/logstash/lib/bootstrap/environment.rb:70

The same error with Java 7

  • edit startup options: JAVACMD="${JAVA_HOME}/bin/java"
  • /usr/share/logstash/bin/system-install
  • ...

/var/log/logstash exists but empty.
What should I try to troubleshoot logstash?

Maybe relevant: only upstart is workingthe old 'service' not:

service logstash start
logstash: unrecognized service
start logstash
logstash start/running, process 16876

OS: Centos 6.7
logstash: 5.1.2

So what else should I do to change the Java runtime?

  • I've changed 'JAVACMD' in /etc/logstash/startup.options
  • run /usr/share/logstash/bin/system-install

What else should I need?

OK, it works only with a properly set JAVA_HOME which points to JAVA 8 instance :slight_smile:

So it is not eough to change the JAVACMD property and generate the startup script again (system-install)

So the best practice is to set up the JAVA_HOME (to a Java8 instance) BEFORE installing elasticsearch

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