Elasticsearch: UnsupportedClassVersionError: ... Unsupported major.minor version 52.0

Created on 24 Oct 2016  Â·  14Comments  Â·  Source: elastic/elasticsearch

Exception in thread "main" java.lang.UnsupportedClassVersionError: org/elasticsearch/bootstrap/Elasticsearch : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)

Elasticsearch version: 5.0.0-alpha1/2/beta1 (5.0RC1)

Plugins installed: [] none

JVM version:

OS version: Ubuntu 12.04 (wheezy/sid)
Linux 3.2.0-69-virtual #103-Ubuntu SMP Tue Sep 2 05:21:29 UTC 2014

Description of the problem including expected versus actual behavior:
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/elasticsearch/bootstrap/Elasticsearch : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)

Steps to reproduce:

  1. run bin/elasticsearch
  2. wait a minute

Most helpful comment

In the future, only comment if you have something more helpful to add, otherwise, STFU and keep it to yourself.

@mtaylor769 if you come to an open source project with statements like this nobody wants to help you anymore if you have a serious issue. The issues are happening on your side of the communication and since you just confessed that the problem was _in front of the keyboard_ this time I think it would be more appropriate to say _thank you and sorry for the time you spend helping me_. I know that won't happen but I at least try to manage expectations next time.

All 14 comments

You need a Java 8 runtime.

I am getting this error even after installing JRE8u111

If you see this error elasticsearch isnt running with Java 8.

On Fri, Dec 16, 2016, 8:07 PM Mike Taylor notifications@github.com wrote:

I am getting this error even after installing JRE8.

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/elastic/elasticsearch/issues/21102#issuecomment-267732039,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AANLoixdRXhLoiWMfKhmJC4htJJ8ARdbks5rIzXagaJpZM4KfTK9
.

I JUST intstalled Java 8. Your comment is invalid.

So, the issue is not _THAT_ the JRE8 is installed, it's HOW it get's installed. On the Oracle Developer Downloads page, there are two options for OSX: '.dmg', and '.tar.gz'. I had used the .dmg to install and was getting this error.

Unlike the flippant "you need Java 8" comments that are ever-so-helpful, especially after confirming my JRE8u111 with Installed Java Checker - I found an article that actually explains why installing using the .dmg is problematic and how to properly install using the .tar.gz file and adding it to the System Library in El Capitan:

Oracle’s JRE 8 on Mac OS X El Capitan

In the future, only comment if you have something more helpful to add, otherwise, STFU and keep it to yourself.

In the future, only comment if you have something more helpful to add, otherwise, STFU and keep it to yourself.

@mtaylor769 if you come to an open source project with statements like this nobody wants to help you anymore if you have a serious issue. The issues are happening on your side of the communication and since you just confessed that the problem was _in front of the keyboard_ this time I think it would be more appropriate to say _thank you and sorry for the time you spend helping me_. I know that won't happen but I at least try to manage expectations next time.

@s1monw I'm not going to say "sorry and thank you" for someone wasting my time, as you felt the need to do the same with your response. Message boards are a last resort for me since I've been programming since before your you were a gleam in your father's eye, so flippant answers, and lectures about my tone are the last things I'm looking for when I'm asking for help, Junior.

I got the followings.

C:elasticsearch-5.2.0bin>elasticsearch.bat
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/elasticsearch/bootstrap/Elasticsearch : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)

C:elasticsearch-5.2.0bin>java -version
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)

C:elasticsearch-5.2.0bin>

what does your %JAVA_HOME% point to?

@s1monw, thx for mentioning the %JAVA_HOME%. It is working.

I am using java version "1.8.0_77" But still getting the same error. My ES version 5.2.0 running RHEL7 without any plugins

Somehow, fixing %JAVA_HOME% didn't make it to work, but forcing %JAVA% in elasticsearch.bat did, like this:

set JAVA="K:aaa_ApplicationsDevelopmentjdk-8u92-windows-i586binjava.exe"
echo %JAVA%

%JAVA% %ES_JAVA_OPTS% %ES_PARAMS% -cp "%ES_CLASSPATH%" "org.elasticsearch.bootstrap.Elasticsearch" !newparams!

@hassanalip It can not work with java 6.

Thanks Dadoonet.
There were multiple java versions installed on the system and even when I had change the elasticsearch script to manually set the JAVA_HOME it was not picking up the correct one. I had to go into update-alternatives to pick the correct java version

Was this page helpful?
0 / 5 - 0 ratings