i'm getting following error, while i'm running code in windows xp service pack 3 with JDK 6 version. I'm not able to install JDK 8.

pls help me

java.lang.UnsupportedClassVersionError: org/openqa/selenium/WebDriver : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Exception in thread "main"

Your comment on this answer:

Email me at this address if a comment is added after mine:Email me if a comment is added after mine

Privacy: Your email address will only be used for sending these notifications.

0 votes

Till you send the code, I would tell you what the problem is according to me.

Actually, java.lang.UnsupportedClassVersionError happens because of a higher JDK during compile time and lower JDK during runtime.

Don't worry, It is actually simple. What you need to do is, you need to first uninstall the JRE/JDK that you have (also the IDE) and then install BOTH JRE / JDK of the same version, like:
JRE 6 -> JDK 6
JRE 7 -> JDK 7

So do i need to install JRE6 and JDK 7?
----------------------------------------------------------------------------------------------------------------------------
After installing JDK7 and JRE6. Still Below error is displaying pls check.