java.lang.UnsupportedClassVersionError: Bad version number in .class file

JIRA | Marc Grue | 6 years ago
  1. 0

    Running qi4j.runtime.AppliesToFilterTest (or most other tests) gives the following error: java.lang.UnsupportedClassVersionError: Bad version number in .class file at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:676) at org.qi4j.runtime.composite.FragmentClassLoader.findClass(FragmentClassLoader.java:80) at java.lang.ClassLoader.loadClass(ClassLoader.java:317) at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at org.qi4j.runtime.bootstrap.AssemblyHelper.instantiationClass(AssemblyHelper.java:64) at org.qi4j.runtime.bootstrap.AssemblyHelper.getMixinModel(AssemblyHelper.java:39) at org.qi4j.runtime.composite.AbstractMixinsModel.implementMethodWithClass(AbstractMixinsModel.java:197) at org.qi4j.runtime.composite.AbstractMixinsModel.implementMethod(AbstractMixinsModel.java:122) at org.qi4j.runtime.composite.CompositeMethodsModel.implementMixinType(CompositeMethodsModel.java:134) at org.qi4j.runtime.composite.CompositeMethodsModel.<init>(CompositeMethodsModel.java:59) at org.qi4j.runtime.composite.TransientModel.newModel(TransientModel.java:65) at org.qi4j.runtime.bootstrap.TransientDeclarationImpl.addComposites(TransientDeclarationImpl.java:89) at org.qi4j.runtime.bootstrap.ModuleAssemblyImpl.assembleModule(ModuleAssemblyImpl.java:263) at org.qi4j.runtime.bootstrap.ApplicationModelFactoryImpl.newApplicationModel(ApplicationModelFactoryImpl.java:69) at org.qi4j.bootstrap.Energy4Java.newApplicationModel(Energy4Java.java:70) at org.qi4j.test.AbstractQi4jTest.newApplication(AbstractQi4jTest.java:100) at org.qi4j.test.AbstractQi4jTest.setUp(AbstractQi4jTest.java:66) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at org.junit.internal.runners.MethodRoadie.runBefores(MethodRoadie.java:122) at org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:86) at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77) at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42) at org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4ClassRunner.java:88) at org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51) at org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44) at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27) at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37) at org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42) at com.intellij.rt.junit4.Junit4ClassSuite.run(Junit4ClassSuite.java:99) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:40) Found this explanation on the internet: "This usually means that your application has been compiled with a newer version of JDK than the version you try to run it with. For example, the source code is compiled with JDK 1.4 but executed with JRE 1.3. JRE 1.3 does not understand the new format of .class files generated by compiler from JDK 1.4 so you get the error message. I think this should not happen unless you downgrade your JDK/JRE or change the Source Level setting in the project's properties." So it seems that some native (?) code is compiled in a newer version unrecognized by JVM 1.5.

    JIRA | 6 years ago | Marc Grue
    java.lang.UnsupportedClassVersionError: Bad version number in .class file
  2. 0

    Running qi4j.runtime.AppliesToFilterTest (or most other tests) gives the following error: java.lang.UnsupportedClassVersionError: Bad version number in .class file at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:676) at org.qi4j.runtime.composite.FragmentClassLoader.findClass(FragmentClassLoader.java:80) at java.lang.ClassLoader.loadClass(ClassLoader.java:317) at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at org.qi4j.runtime.bootstrap.AssemblyHelper.instantiationClass(AssemblyHelper.java:64) at org.qi4j.runtime.bootstrap.AssemblyHelper.getMixinModel(AssemblyHelper.java:39) at org.qi4j.runtime.composite.AbstractMixinsModel.implementMethodWithClass(AbstractMixinsModel.java:197) at org.qi4j.runtime.composite.AbstractMixinsModel.implementMethod(AbstractMixinsModel.java:122) at org.qi4j.runtime.composite.CompositeMethodsModel.implementMixinType(CompositeMethodsModel.java:134) at org.qi4j.runtime.composite.CompositeMethodsModel.<init>(CompositeMethodsModel.java:59) at org.qi4j.runtime.composite.TransientModel.newModel(TransientModel.java:65) at org.qi4j.runtime.bootstrap.TransientDeclarationImpl.addComposites(TransientDeclarationImpl.java:89) at org.qi4j.runtime.bootstrap.ModuleAssemblyImpl.assembleModule(ModuleAssemblyImpl.java:263) at org.qi4j.runtime.bootstrap.ApplicationModelFactoryImpl.newApplicationModel(ApplicationModelFactoryImpl.java:69) at org.qi4j.bootstrap.Energy4Java.newApplicationModel(Energy4Java.java:70) at org.qi4j.test.AbstractQi4jTest.newApplication(AbstractQi4jTest.java:100) at org.qi4j.test.AbstractQi4jTest.setUp(AbstractQi4jTest.java:66) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at org.junit.internal.runners.MethodRoadie.runBefores(MethodRoadie.java:122) at org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:86) at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77) at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42) at org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4ClassRunner.java:88) at org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51) at org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44) at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27) at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37) at org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42) at com.intellij.rt.junit4.Junit4ClassSuite.run(Junit4ClassSuite.java:99) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:40) Found this explanation on the internet: "This usually means that your application has been compiled with a newer version of JDK than the version you try to run it with. For example, the source code is compiled with JDK 1.4 but executed with JRE 1.3. JRE 1.3 does not understand the new format of .class files generated by compiler from JDK 1.4 so you get the error message. I think this should not happen unless you downgrade your JDK/JRE or change the Source Level setting in the project's properties." So it seems that some native (?) code is compiled in a newer version unrecognized by JVM 1.5.

    JIRA | 6 years ago | Marc Grue
    java.lang.UnsupportedClassVersionError: Bad version number in .class file
  3. 0

    Eclipse Android SDK: Bad version number in .class file

    Stack Overflow | 5 years ago | Stefano Cortellino
    java.lang.UnsupportedClassVersionError: Bad version number in .class file
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    help - testng doesnt work on the mac with eclipse: Bad version number in .class file

    Stack Overflow | 6 years ago | wingnut
    java.lang.UnsupportedClassVersionError: Bad version number in .class file
  6. 0

    Can't load any mxj with Max 5.1.7 and leopard snow - Cycling '74 Forums

    cycling74.com | 2 years ago
    java.lang.UnsupportedClassVersionError: Bad version number in .class file

    14 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.UnsupportedClassVersionError

      Bad version number in .class file

      at java.lang.ClassLoader.defineClass1()
    2. Java RT
      ClassLoader.defineClass
      1. java.lang.ClassLoader.defineClass1(Native Method)
      2. java.lang.ClassLoader.defineClass(ClassLoader.java:676)
      2 frames
    3. org.qi4j.runtime
      FragmentClassLoader.findClass
      1. org.qi4j.runtime.composite.FragmentClassLoader.findClass(FragmentClassLoader.java:80)
      1 frame
    4. Java RT
      ClassLoader.loadClass
      1. java.lang.ClassLoader.loadClass(ClassLoader.java:317)
      2. java.lang.ClassLoader.loadClass(ClassLoader.java:252)
      2 frames
    5. org.qi4j.runtime
      ApplicationModelFactoryImpl.newApplicationModel
      1. org.qi4j.runtime.bootstrap.AssemblyHelper.instantiationClass(AssemblyHelper.java:64)
      2. org.qi4j.runtime.bootstrap.AssemblyHelper.getMixinModel(AssemblyHelper.java:39)
      3. org.qi4j.runtime.composite.AbstractMixinsModel.implementMethodWithClass(AbstractMixinsModel.java:197)
      4. org.qi4j.runtime.composite.AbstractMixinsModel.implementMethod(AbstractMixinsModel.java:122)
      5. org.qi4j.runtime.composite.CompositeMethodsModel.implementMixinType(CompositeMethodsModel.java:134)
      6. org.qi4j.runtime.composite.CompositeMethodsModel.<init>(CompositeMethodsModel.java:59)
      7. org.qi4j.runtime.composite.TransientModel.newModel(TransientModel.java:65)
      8. org.qi4j.runtime.bootstrap.TransientDeclarationImpl.addComposites(TransientDeclarationImpl.java:89)
      9. org.qi4j.runtime.bootstrap.ModuleAssemblyImpl.assembleModule(ModuleAssemblyImpl.java:263)
      10. org.qi4j.runtime.bootstrap.ApplicationModelFactoryImpl.newApplicationModel(ApplicationModelFactoryImpl.java:69)
      10 frames
    6. org.qi4j.bootstrap
      Energy4Java.newApplicationModel
      1. org.qi4j.bootstrap.Energy4Java.newApplicationModel(Energy4Java.java:70)
      1 frame
    7. org.qi4j.test
      AbstractQi4jTest.setUp
      1. org.qi4j.test.AbstractQi4jTest.newApplication(AbstractQi4jTest.java:100)
      2. org.qi4j.test.AbstractQi4jTest.setUp(AbstractQi4jTest.java:66)
      2 frames
    8. Java RT
      DelegatingMethodAccessorImpl.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      3 frames
    9. JUnit
      JUnit4ClassRunner.run
      1. org.junit.internal.runners.MethodRoadie.runBefores(MethodRoadie.java:122)
      2. org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:86)
      3. org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77)
      4. org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42)
      5. org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4ClassRunner.java:88)
      6. org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51)
      7. org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44)
      8. org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27)
      9. org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37)
      10. org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42)
      10 frames
    10. com.intellij.rt
      Junit4ClassSuite.run
      1. com.intellij.rt.junit4.Junit4ClassSuite.run(Junit4ClassSuite.java:99)
      1 frame
    11. IDEA
      JUnitStarter.main
      1. com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:40)
      1 frame