File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
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: 556
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: 556
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
 
Similar Threads
Compiling java file with JRE 1.5.0_22, but the output class shows version 1.6 : 50.0, super bit ?
Reg : java.lang.UnsupportedClassVersionError
tomcat servlet deployment on a mac
Mac-specific applet-Javascript communication problem
IText PDF Encryptor