# Java – How to Fix java.lang.UnsupportedClassVersionError Error?

This article represents tips on how to fix Java error such as UnsupportedClassVersionError. Please feel free to comment/suggest if I missed to mention one or more important points. Also, sorry for the typos.
###### How to Reproduce the Error?
• Set the JAVA_HOME with one version of Java. And, include “bin” of different Java version in PATH variable.
• Compile the class, say, HelloWorld.java with “javac” command
• Start the JVM with following class: “java HelloWorld”

With above, you could see error such as following:

java.lang.UnsupportedClassVersionError: HelloWorld : Unsupported major.minor ver
sion 52.0
at java.net.URLClassLoader.access$100(Unknown Source) at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)


I set the JAVA_HOME for jdk 8.* and set the jdk7.* in PATH.

###### How to Fix the java.lang.UnsupportedClassVersionError?

Make sure that same version is set as JAVA_HOME as included in PATH variable (%JAVA_HOME%/bin)