PDA

View Full Version : Strange Error



DBQ
August 11th, 2007, 05:35 PM
Hey Guys,
I get this error when I try to run a java jar program. It worked fine on the other system. What should I do?

Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in .class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java :620)
at java.security.SecureClassLoader.defineClass(Secure ClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader .java:260)
at java.net.URLClassLoader.access$100(URLClassLoader. java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java: 195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.j ava:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:3 06)
at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:268)
at java.lang.ClassLoader.loadClass(ClassLoader.java:2 51)
at java.lang.ClassLoader.loadClassInternal(ClassLoade r.java:319)
?

nitro_n2o
August 11th, 2007, 08:15 PM
you need to recompile everything i suppose..
I'm not sure if there is another thing you can do..
But recompiling will solve it

DBQ
August 12th, 2007, 04:30 AM
I tried it, but it did not help. I think the problem is with java. Do you have to install some libraries perhaps?

nitro_n2o
August 12th, 2007, 10:56 AM
no it's not Java i'm sure.. that used to happen to me when using eclipse to compile and then using the command line.. classes gets confused :)
try to delete all class files and compile again... and if you have a Manifest.mf file make sure it doesn't have the java class version (make sure you have a simple manifest file)
And this might happen if you compiled your code using javac 1.6 but run by java 1.5
check your java stuff versions
javac -version
java -version
javac must be lower than java, yet better they both be the same