Uncategories

Elasticsearch – Exception in thread “main” java.lang.UnsupportedClassVersionError: org/elasticse arch/bootstrap/Elasticsearch : Unsupported major.minor version 52.0

Problem:

I have download Elasticsearch 5.1.2 and tried to install it on my laptop Windows7 – 64bit and get this error:

C:\elasticsearch-5.1.2>.\bin\elasticsearch
Exception in thread “main” java.lang.UnsupportedClassVersionError: org/elasticse
arch/bootstrap/Elasticsearch : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:14
2)
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:423)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:472)

My JAVA version:

C:\elasticsearch-5.1.2>java -version
java version “1.8.0_121”
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)

Cause:
JAVA_HOME is wrongly set

Solution:
Need to set JAVA_HOME to version 1.8

C:\elasticsearch-5.1.2>set JAVA_HOME=C:\Program Files\Java\jre1.8.0_121

Result: Succsessfully installed and started .

Set JAVA_Home path on linux:
https://www.cyberciti.biz/faq/linux-unix-set-java_home-path-variable/

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s