java.lang.UnsupportedClassVersionError

Bad version number in .class file

Samebug tips4

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.

If you're using intellij plugin of sonarqube, you might have to set the JAVA_HOME ambient variable manually.

Don't give up yet. Our experts can help. Paste your full stack trace to get a solution.

Solutions on the web4787

  • via Coderanch by Dave Alvarado, 7 months ago
    Bad version number in .class file
  • via Coderanch by Rajeev Ravindran, 11 months ago
    Bad version number in .class file
  • via Coderanch by Oczek Oczkowy, 9 months ago
    Bad version number in .class file
  • Stack trace

    • java.lang.UnsupportedClassVersionError: Bad version number in .class file 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 org.codehaus.plexus.classworlds.realm.ClassRealm.loadClassFromSelf(ClassRealm.java:386) at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:42) at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:244) at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:230) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) at java.lang.Class.getDeclaredConstructors0(Native Method) at java.lang.Class.privateGetDeclaredConstructors(Class.java:2357) at java.lang.Class.getDeclaredConstructors(Class.java:1808) at com.google.inject.spi.InjectionPoint.forConstructorOf(InjectionPoint.java:243) at com.google.inject.internal.ConstructorBindingImpl.create(ConstructorBindingImpl.java:96) at com.google.inject.internal.InjectorImpl.createUninitializedBinding(InjectorImpl.java:628) at com.google.inject.internal.InjectorImpl.createJustInTimeBinding(InjectorImpl.java:835) at com.google.inject.internal.InjectorImpl.createJustInTimeBindingRecursive(InjectorImpl.java:769) at com.google.inject.internal.InjectorImpl.getJustInTimeBinding(InjectorImpl.java:254) at com.google.inject.internal.InjectorImpl.getBindingOrThrow(InjectorImpl.java:205) at com.google.inject.internal.InjectorImpl.getInternalFactory(InjectorImpl.java:843) at com.google.inject.internal.InjectorImpl.getProviderOrThrow(InjectorImpl.java:957) at com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:990) at com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:951) at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1003) at org.sonatype.guice.bean.reflect.AbstractDeferredClass.get(AbstractDeferredClass.java:47) at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40) at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46) at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1021) at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40) at com.google.inject.Scopes$1$1.get(Scopes.java:59) at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40) at com.google.inject.internal.InjectorImpl$4$1.call(InjectorImpl.java:968) at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1014) at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:964) at org.sonatype.guice.bean.locators.LazyBeanEntry.getValue(LazyBeanEntry.java:79) at org.sonatype.guice.plexus.locators.LazyPlexusBean.getValue(LazyPlexusBean.java:53) at org.sonatype.guice.bean.locators.EntryListAdapter$ValueIterator.next(EntryListAdapter.java:112) at java.util.AbstractCollection.addAll(AbstractCollection.java:318) at org.apache.maven.DefaultMaven.getLifecycleParticipants(DefaultMaven.java:514) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:214) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156) at org.jvnet.hudson.maven3.launcher.Maven3Launcher.main(Maven3Launcher.java:79) 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.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:329) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:239) at org.jvnet.hudson.maven3.agent.Maven3Main.launch(Maven3Main.java:158) at hudson.maven.Maven3Builder.call(Maven3Builder.java:104) at hudson.maven.Maven3Builder.call(Maven3Builder.java:70) at hudson.remoting.UserRequest.perform(UserRequest.java:118) at hudson.remoting.UserRequest.perform(UserRequest.java:48) at hudson.remoting.Request$2.run(Request.java:287) at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269) at java.util.concurrent.FutureTask.run(FutureTask.java:123) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:651) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:676) at java.lang.Thread.run(Thread.java:595)

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    Once, 1 month ago
    2 times, 5 months ago
    Unknown user
    Once, 9 months ago
    Unknown user
    Once, 10 months ago
    Unknown user
    Once, 10 months ago
    193 more bugmates