Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnsupportedClassVersionError: ... Unsupported major.minor version 52.0 #21102

Closed
JazzFan opened this issue Oct 24, 2016 · 15 comments
Closed

UnsupportedClassVersionError: ... Unsupported major.minor version 52.0 #21102

JazzFan opened this issue Oct 24, 2016 · 15 comments

Comments

@JazzFan
Copy link

JazzFan commented Oct 24, 2016

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
@jasontedor
Copy link
Member

You need a Java 8 runtime.

@mtaylor769
Copy link

mtaylor769 commented Dec 17, 2016

I am getting this error even after installing JRE8u111

@nik9000
Copy link
Member

nik9000 commented Dec 17, 2016 via email

@mtaylor769
Copy link

I JUST intstalled Java 8. Your comment is invalid.

@mtaylor769
Copy link

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.

@s1monw
Copy link
Contributor

s1monw commented Dec 17, 2016

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.

@mtaylor769
Copy link

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

@Tomket
Copy link

Tomket commented Feb 6, 2017

I got the followings.

C:\elasticsearch-5.2.0\bin>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.0\bin>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.0\bin>

@s1monw
Copy link
Contributor

s1monw commented Feb 6, 2017

what does your %JAVA_HOME% point to?

@Tomket
Copy link

Tomket commented Feb 6, 2017

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

@cvemula1
Copy link

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

@hgc2002
Copy link

hgc2002 commented Feb 16, 2017

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

set JAVA="K:\aaa_Applications\Development\jdk-8u92-windows-i586\bin\java.exe"
echo %JAVA%

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

@dadoonet
Copy link
Member

dadoonet commented Mar 9, 2017

@hassanalip It can not work with java 6.

@hassanalip
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

11 participants