Reputation: 41
i have this problem with tomcat 5.5 (jdk 1.5). this only happens when i try to run in debug mode. when i run the server in "Normal mode" everything works fine.
java.lang.UnsupportedClassVersionError: Bad version number in .class file
FATAL ERROR in native method: processing of -javaagent failed
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.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.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:133)
Exception in thread "main"
Upvotes: 4
Views: 6623
Reputation: 43
This error would suggest that you compiled the code using a JDK later than the JRE which is running the code.
For example, you may have your Eclipse Execution Environment for J2SE-1.5 set to jdk1.5.0_05 but your build path is using version jdk1.5.0_22
I was able to reproduce your bug just now with an otherwise empty main function compiled in jdk1.5.0_22 and then debugged as an application running in a jdk1.5.0_05 environment.
So I suggest that you try using a different version of the JDK.
Upvotes: 4