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

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Samebug tips

,
via Stack Overflow by ERJAN

This exception occurs when using an older version of java. Mainly when trying to run a jar compiled with a newer Java version in an older Java version. We can avoid this issue by executing the jar in the same version which it was compiled.

,
Expert tip

This might be caused by and outdated version of Java, SonarQube now uses Java 8 as default. You might upgrade java or use an older version of SonarQube.

Solutions on the web

via one-jar by sforge-kumar
, 8 months ago
Bad version number in .class file
via Oracle Community by 843859, 3 months ago
Bad version number in .class file
via Google Groups by RickHigh, 2 years ago
Bad version number in .class file
via Google Groups by raq, 1 year ago
Bad version number in .class file
via gotoanswer.com by Unknown author, 2 years ago
via Google Groups by zab, 3 months ago
Bad version number in .class file
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.apache.felix.framework.ModuleImpl$ModuleClassLoader.findClass(ModuleImpl.java:1872)
at org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:758)
at org.apache.felix.framework.ModuleImpl.access$100(ModuleImpl.java:61)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at org.apache.felix.framework.ModuleImpl.searchImports(ModuleImpl.java:1440)
at org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:753)
at org.apache.felix.framework.ModuleImpl.access$100(ModuleImpl.java:61)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:375)
at org.springframework.roo.addon.gwt.GwtMetadataProvider.getProvidesType(GwtMetadataProvider.java:206)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:592)
at org.apache.felix.scr.impl.helper.BaseMethod.invokeMethod(BaseMethod.java:213)
at org.apache.felix.scr.impl.helper.BaseMethod.access$500(BaseMethod.java:38)
at org.apache.felix.scr.impl.helper.BaseMethod$Resolved.invoke(BaseMethod.java:542)
at org.apache.felix.scr.impl.helper.BaseMethod.invoke(BaseMethod.java:434)
at org.apache.felix.scr.impl.helper.ActivateMethod.invoke(ActivateMethod.java:138)
at org.apache.felix.scr.impl.manager.ImmediateComponentManager.createImplementationObject(ImmediateComponentManager.java:226)
at org.apache.felix.scr.impl.manager.ImmediateComponentManager.createComponent(ImmediateComponentManager.java:118)
at org.apache.felix.scr.impl.manager.AbstractComponentManager$Unsatisfied.activate(AbstractComponentManager.java:991)
at org.apache.felix.scr.impl.manager.AbstractComponentManager.activateInternal(AbstractComponentManager.java:298)
at org.apache.felix.scr.impl.manager.AbstractComponentManager$3.doRun(AbstractComponentManager.java:505)
at org.apache.felix.scr.impl.ComponentActivatorTask.run(ComponentActivatorTask.java:67)
at org.apache.felix.scr.impl.ComponentActorThread.run(ComponentActorThread.java:96)
at java.lang.Thread.run(Thread.java:613)

Users with the same issue

Once, 2 weeks ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago

Write tip

Know the solutions? Share your knowledge to help other developers to debug faster.