*
The moose likes IDEs, Version Control and other tools and the fly likes eclipse junit java.lang.UnsupportedClassVersionError: Bad version number in .class file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "eclipse junit java.lang.UnsupportedClassVersionError: Bad version number in .class file " Watch "eclipse junit java.lang.UnsupportedClassVersionError: Bad version number in .class file " New topic
Author

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

Tony Evans
Ranch Hand

Joined: Jun 29, 2002
Posts: 573
When I run my junit I get the two standard eclipse junit bug errors

1) UnsupportedClassVersionError: Bad version number in .class file

And

2) Class not found com.myapp.MyClass when juint testing myclass.

My JAVA_HOME is pointing at 1.6 eclipse/window/preferences/java/compliler is pointing at 1.6

But when I run my junit its looking at jre1.5.09 how do I configure junit tests in eclipse to make sure they all look run the same complier

Thanks
Tony Evans
Ranch Hand

Joined: Jun 29, 2002
Posts: 573
Fixed when setting your JDK1.6 in eclipse eindows preferences java/complier select at the bottom of the preferences if you are not using the right jre it will prompt you, make sure its using the same version as your JDK in my case 1.6
 
jQuery in Action, 2nd edition
 
subject: eclipse junit java.lang.UnsupportedClassVersionError: Bad version number in .class file
 
Similar Threads
Mac-specific applet-Javascript communication problem
IText PDF Encryptor
Compiling java file with JRE 1.5.0_22, but the output class shows version 1.6 : 50.0, super bit ?
tomcat servlet deployment on a mac
Reg : java.lang.UnsupportedClassVersionError