Java.lang.UnsupportedClassVersionError: bad version number in the .class file

advertisements

I am getting the follwing error while running selenium testcase.

 java.lang.UnsupportedClassVersionError: Bad version number in .class file

I have checked all the versions of java in eclispse and they are correct.

Please it would be greatful if you can help me out.


UnsupportedClassVersionError occurs typically when you have .class (typically in .jar-file) that has been compiled with higher version of java than virtual machine trying to run it. For example you have a .class-file that is compiled with JDK 6 and you are trying to run it with 1.4 JVM.

Check your PATH variable and test java -version command etc. Also check this thread for couple typical issues that cause this problem.