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 Google Groups by dmp, 10 months ago
org/postgresql/Driver : Unsupported major.minor version 51.0
via Google Groups by RickHigh, 2 years ago
Bad version number in .class file
via one-jar by sforge-kumar
, 8 months ago
Bad version number in .class file
via Oracle Community by 802550, 1 year ago
via Oracle Community by 843859, 3 months ago
Bad version number in .class file
via Stack Overflow by alex
, 2 years 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)

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.