Hi, I recently installed Elasticsearch on my server - while starting I'm getting below exception:
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/elasticsearch/bootstrap/Elasticsearch : Unsupported major.minor version 51.0
I've setup JDK1.8 and done everything required:
java -version
java version "1.8.0_60"
Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)
echo $JAVA_HOME
/u01/apps/java/jdk1.8.0_60
Appreciate your help to resolve this issue please.
Version 51.0 is java 7. So, this would happen if you are trying to run ES with java 6. Maybe you have a java 6 installation? If this is the case, then the elasticsearch startup script is picking up that version somehow...
Package elasticsearch-1.3.9-1.noarch already installed and latest version
Nothing to do
[xxxxx@xxxxxxxx~]$ sudo service elasticsearch restart
[sudo] password for ecomm:
Stopping elasticsearch: [FAILED]
Starting elasticsearch: [ OK ]
[xxxxx@xxxxxxxx~]$ Exception in thread "main" java.lang.UnsupportedClassVersionError: org/elasticsearch/bootstrap/Elasticsearch : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:634)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)
at java.net.URLClassLoader.access$000(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:212)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
Could not find the main class: org.elasticsearch.bootstrap.Elasticsearch. Program will exit.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.