# \[NEWUSER\] JRuby ext built for wrong Java version

**URL:** <https://discuss.elastic.co/t/newuser-jruby-ext-built-for-wrong-java-version/66571>\
**Category:** Logstash\
**Created:** [November 18, 2016, 5:56pm UTC](https://discuss.elastic.co/t/newuser-jruby-ext-built-for-wrong-java-version/66571 "2016-11-18T17:56:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![utdrmac](https://avatars.discourse-cdn.com/v4/letter/u/e274bd/32.png) [@utdrmac](https://discuss.elastic.co/u/utdrmac)\
**Post date:** [November 18, 2016, 5:56pm UTC](https://discuss.elastic.co/t/newuser-jruby-ext-built-for-wrong-java-version/66571/1 "2016-11-18T17:56:40Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![utdrmac](https://avatars.discourse-cdn.com/v4/letter/u/e274bd/32.png) [@utdrmac](https://discuss.elastic.co/u/utdrmac)\
**Post date:** [November 18, 2016, 8:06pm UTC](https://discuss.elastic.co/t/newuser-jruby-ext-built-for-wrong-java-version/66571/2 "2016-11-18T20:06:35Z")

</div>

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.

---

<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:** [December 16, 2016, 8:06pm UTC](https://discuss.elastic.co/t/newuser-jruby-ext-built-for-wrong-java-version/66571/3 "2016-12-16T20:06:39Z")

</div>

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