java.lang.UnsupportedClassVersionError

If you like a tip written by other Samebug users, mark is as helpful! Marks help our algorithm provide you better solutions and also help other users.
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.

tip

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

tip

Update "latest" to Java 8 on DockerHub.

tip

You're using an older version of java with classes compiled for java7

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

  • Re: UIMA repsotory
    via by Eric Riebling,
  • Re: UIMA repsotory
    via by Eric Riebling,
  • Does jetty 6.1.8 supports jdk 1.5?
    via Stack Overflow by dara
    ,
  • invalid JChemWebServices.aar service
    via by Unknown author,
  • Jenkins fail to start with an Exception due to JDK1.5 incompatibility : java.lang.UnsupportedClassVersionError: Bad version number in .class file at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:620) 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 winstone.classLoader.WebappClassLoader.loadClass(WebappClassLoader.java:68) at java.lang.ClassLoader.loadClass(ClassLoader.java:251) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) at hudson.security.PermissionScope.<init>(PermissionScope.java:70) at hudson.security.PermissionScope.<clinit>(PermissionScope.java:95) at hudson.security.Permission.<init>(Permission.java:179) at hudson.security.Permission.<clinit>(Permission.java:292) at jenkins.model.Jenkins.<clinit>(Jenkins.java:3817) at hudson.WebAppMain.installLogger(WebAppMain.java:256) at hudson.WebAppMain.contextInitialized(WebAppMain.java:107) at winstone.WebAppConfiguration.<init>(WebAppConfiguration.java:875) at winstone.HostConfiguration.initWebApp(HostConfiguration.java:129) at winstone.HostConfiguration.<init>(HostConfiguration.java:71) at winstone.HostGroup.initHost(HostGroup.java:87) at winstone.HostGroup.<init>(HostGroup.java:47) at winstone.Launcher.<init>(Launcher.java:177) at winstone.Launcher.main(Launcher.java:384) 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:585) at Main._main(Main.java:273) at Main.main(Main.java:98) It seems to come from usage of the last Guava release version that doesn't support JDK1.5 (http://code.google.com/p/guava-libraries/wiki/Release12#JDK6_APIs) Change that seems to be reponsible from this error : https://github.com/jenkinsci/jenkins/commit/95c8707511e83af772d29b25d30343d2d58bcbad
    via by Ludovic Meurillon,
  • When I try to update a password on "Configure" view for a specific User jenkins return a HTTP 500 with a stackTrace : javax.servlet.ServletException: java.lang.UnsupportedClassVersionError: Bad version number in .class file at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:616) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:659) at org.kohsuke.stapler.MetaClass$6.doDispatch(MetaClass.java:241) at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53) at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:574) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:659) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:488) at org.kohsuke.stapler.Stapler.service(Stapler.java:162) at javax.servlet.http.HttpServlet.service(HttpServlet.java:45) at winstone.ServletConfiguration.execute(ServletConfiguration.java:248) at winstone.RequestDispatcher.forward(RequestDispatcher.java:333) at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:376) at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:95) at hudson.plugins.greenballs.GreenBallFilter.doFilter(GreenBallFilter.java:58) at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:98) at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:87) at winstone.FilterConfiguration.execute(FilterConfiguration.java:194) at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:366) at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:47) at winstone.FilterConfiguration.execute(FilterConfiguration.java:194) at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:366) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84) at hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:166) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at org.acegisecurity.ui.basicauth.BasicProcessingFilter.doFilter(BasicProcessingFilter.java:173) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at jenkins.security.ApiTokenFilter.doFilter(ApiTokenFilter.java:63) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249) at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:66) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76) at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:164) at winstone.FilterConfiguration.execute(FilterConfiguration.java:194) at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:366) at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:50) at winstone.FilterConfiguration.execute(FilterConfiguration.java:194) at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:366) at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:81) at winstone.FilterConfiguration.execute(FilterConfiguration.java:194) at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:366) at winstone.RequestDispatcher.forward(RequestDispatcher.java:331) at winstone.RequestHandlerThread.processRequest(RequestHandlerThread.java:215) at winstone.RequestHandlerThread.run(RequestHandlerThread.java:138) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269) at java.util.concurrent.FutureTask.run(FutureTask.java:123) at winstone.BoundedExecutorService$1.run(BoundedExecutorService.java:77) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675) at java.lang.Thread.run(Thread.java:595) Caused by: java.lang.UnsupportedClassVersionError: Bad version number in .class file at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:620) 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 winstone.classLoader.WebappClassLoader.loadClass(WebappClassLoader.java:68) at java.lang.ClassLoader.loadClass(ClassLoader.java:251) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) at hudson.security.HudsonPrivateSecurityRealm$3.encodePassword(HudsonPrivateSecurityRealm.java:621) at hudson.security.HudsonPrivateSecurityRealm$4.encodePassword(HudsonPrivateSecurityRealm.java:641) at hudson.security.HudsonPrivateSecurityRealm$Details.fromPlainPassword(HudsonPrivateSecurityRealm.java:441) at hudson.security.HudsonPrivateSecurityRealm$Details$DescriptorImpl.newInstance(HudsonPrivateSecurityRealm.java:525) at hudson.security.HudsonPrivateSecurityRealm$Details$DescriptorImpl.newInstance(HudsonPrivateSecurityRealm.java:501) at hudson.model.User.doConfigSubmit(User.java:520) 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:585) at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:288) at org.kohsuke.stapler.interceptor.RequirePOST$Processor.invoke(RequirePOST.java:28) at org.kohsuke.stapler.Function$InterceptedFunction.invoke(Function.java:389) at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:151) at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:90) at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:111) at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53) at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:574) ... 58 more It seems it appears with the use of a BCrypt class coming from org.mindrot:jbcrypt:0.3m added on this commit to the pom.xml : https://github.com/jenkinsci/jenkins/commit/9bdaf8daaf0798c7aa740c44b1fccbef20858bad
    via by Ludovic Meurillon,
    • java.lang.UnsupportedClassVersionError: Bad version number in .class file at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:620) 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.apache.uima.internal.util.UIMAClassLoader.loadClass(UIMAClassLoader.java:147) at java.lang.ClassLoader.loadClass(ClassLoader.java:251) at org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.initializeAnalysisComponent(PrimitiveAnalysisEngine_impl.java:202) at org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.initialize(PrimitiveAnalysisEngine_impl.java:157) at org.apache.uima.impl.AnalysisEngineFactory_impl.produceResource(AnalysisEngineFactory_impl.java:94) at org.apache.uima.impl.CompositeResourceFactory_impl.produceResource(CompositeResourceFactory_impl.java:62) at org.apache.uima.UIMAFramework.produceResource(UIMAFramework.java:258) at org.apache.uima.UIMAFramework.produceResource(UIMAFramework.java:303) at org.apache.uima.UIMAFramework.produceAnalysisEngine(UIMAFramework.java:383) at org.apache.uima.pear.tools.InstallationTester.testAnalysisEngine(InstallationTester.java:219) at org.apache.uima.pear.tools.InstallationTester.doTest(InstallationTester.java:114) at org.apache.uima.pear.tools.InstallationController.verifyComponentInstallation(InstallationController.java:1110) at org.apache.uima.pear.tools.InstallationController.verifyComponent(InstallationController.java:1993) at org.apache.uima.tools.pear.install.InstallPear.installPear(InstallPear.java:388) at org.apache.uima.tools.pear.install.InstallPear.access$000(InstallPear.java:79) at org.apache.uima.tools.pear.install.InstallPear$RunInstallation.run(InstallPear.java:108) at java.lang.Thread.run(Thread.java:595)

    Users with the same issue

    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    andyglick
    1 times, last one,
    rafael
    2 times, last one,
    Unknown visitor1 times, last one,
    192 more bugmates