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

Jenkins JIRA | Mike Holland | 6 years ago
  1. Speed up your debug routine!

    Automated exception search integrated into your IDE

  2. 0

    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

    Jenkins JIRA | 5 years ago | Ludovic Meurillon
    java.lang.UnsupportedClassVersionError: Bad version number in .class file

    34 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
      URLClassLoader.findClass
      1. java.lang.ClassLoader.defineClass1(Native Method)
      2. java.lang.ClassLoader.defineClass(ClassLoader.java:620)
      3. java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
      4. java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
      5. java.net.URLClassLoader.access$100(URLClassLoader.java:56)
      6. java.net.URLClassLoader$1.run(URLClassLoader.java:195)
      7. java.security.AccessController.doPrivileged(Native Method)
      8. java.net.URLClassLoader.findClass(URLClassLoader.java:188)
      8 frames
    3. winstone.classLoader
      WebappClassLoader.loadClass
      1. winstone.classLoader.WebappClassLoader.loadClass(WebappClassLoader.java:68)
      1 frame
    4. Java RT
      ClassLoader.loadClassInternal
      1. java.lang.ClassLoader.loadClass(ClassLoader.java:251)
      2. java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
      2 frames
    5. Hudson
      WebAppMain$2.run
      1. hudson.DNSMultiCast.<init>(DNSMultiCast.java:26)
      2. hudson.model.Hudson.<init>(Hudson.java:691)
      3. hudson.model.Hudson.<init>(Hudson.java:605)
      4. hudson.WebAppMain$2.run(WebAppMain.java:221)
      4 frames