bad version number in class file


While starting a Jboss process I am getting “Bad version number in .class file” error. What is the root cause?

 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(

at Method)
at java.lang.ClassLoader.loadClass(
at sun.misc.Launcher$AppClassLoader.loadClass(
at java.lang.ClassLoader.loadClass(
at java.lang.ClassLoader.loadClassInternal(

Check whether the class or jar file compiled with a higher version of java than the Jre running the jboss server. This can be checked by doing a “java -version” in the application server machine and check the MANIFEST.MF file in jar file.

Usually java is not backward compatible, so if the jar file is complied with higher version of java than the java running the application server process this issue occurs. To avoid this issue recompile the jar with the same version of java which runs the app server process. E.g: If 1.5.x JDK is used to run Java app server process then compiling the jar file with same 1.5.x JDK solves the issue

In case of any ©Copyright or missing credits issue please check CopyRights page for faster resolutions.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.