aspose file tools*
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: eclipse junit java.lang.UnsupportedClassVersionError: Bad version number in .class file