[NEWUSER] JRuby ext built for wrong Java version

Hi there. First time user of Logstash. I just installed OpenJDK 1.8 onto this machine

[root@hotspare ~]# rpm -qa | grep openjdk
java-1.8.0-openjdk-1.8.0.111-0.b15.el6_8.x86_64
java-1.8.0-openjdk-headless-1.8.0.111-0.b15.el6_8.x86_64

Verified the java version:

[root@hotspare ~]# java -version
openjdk version "1.8.0_111"
OpenJDK Runtime Environment (build 1.8.0_111-b15)
OpenJDK 64-Bit Server VM (build 25.111-b15, mixed mode)

I installed Logstash like this:

[root@hotspare ~]# yum install https://artifacts.elastic.co/downloads/logstash/logstash-5.0.1.rpm

I'm attempting to run the "hello world" and I've got this error:

[root@hotspare logstash]# DEBUG=1 bin/logstash -e 'input { stdin { } } output { stdout {} }'
DEBUG: exec /usr/share/logstash/vendor/jruby/bin/jruby --1.9 /usr/share/logstash/lib/bootstrap/environment.rb logstash/runner.rb -e input { stdin { } } output { stdout {} }
LoadError: JRuby ext built for wrong Java version in `JrubyEventExtService': java.lang.UnsupportedClassVersionError: JrubyEventExtService : Unsupported major.minor version 52.0
  require at org/jruby/RubyKernel.java:1040
   (root) at /usr/share/logstash/logstash-core-event-java/lib/logstash-core-event-java/logstash-core-event-java.rb:25
  require at org/jruby/RubyKernel.java:1040
   (root) at /usr/share/logstash/logstash-core-event-java/lib/logstash-core-event.rb:1
  require at org/jruby/RubyKernel.java:1040
   (root) at /usr/share/logstash/logstash-core-event-java/lib/logstash-core-event.rb:1
  require at org/jruby/RubyKernel.java:1040
   (root) at /usr/share/logstash/logstash-core-event-java/lib/logstash/event.rb:1
  require at org/jruby/RubyKernel.java:1040
   (root) at /usr/share/logstash/logstash-core-event-java/lib/logstash/event.rb:54
  require at org/jruby/RubyKernel.java:1040
   (root) at /usr/share/logstash/logstash-core/lib/logstash/instrument/snapshot.rb:1
  require at org/jruby/RubyKernel.java:1040
   (root) at /usr/share/logstash/logstash-core/lib/logstash/instrument/snapshot.rb:3
  require at org/jruby/RubyKernel.java:1040
   (root) at /usr/share/logstash/lib/bootstrap/environment.rb:67

What did I do wrong? I followed the documentation for this. It said Java 8 is required; and I installed that. What's this ruby issue? How do I get this to work? CentOS 6.8 (Final)

JAVA_HOME and JRE_HOME were not pointing to the correct paths. I found these environment variables buried in /etc/profile Setting them to the correct paths made everything work.

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