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

Jenkins JIRA | Sébastien Heurtematte | 5 years ago
  1. 0

    UnsupportedClassVersionError when running build with jdk 1.5 To reproduce : Declare JDK 5 in jenkins configuration Create a job : freestyle project Configure job : with Ant/Ivy-Artifactory Integration Stacktrace : [latest] $ /usr/lib/ant/apache-ant-1.7.1/bin/ant -file build.xml livraison -v -lib /var/lib/jenkins/plugins/artifactory/WEB-INF/lib -listener org.jfrog.build.extractor.listener.ArtifactoryBuildListener Apache Ant version 1.7.1 compiled on June 27 2008 Buildfile: build.xml BUILD FAILED Class org.jfrog.build.extractor.listener.ArtifactoryBuildListener could not be loaded because of an invalid dependency. at org.apache.tools.ant.util.ClasspathUtils.newInstance(ClasspathUtils.java:296) at org.apache.tools.ant.Main.addBuildListeners(Main.java:799) at org.apache.tools.ant.Main.runBuild(Main.java:681) at org.apache.tools.ant.Main.startAnt(Main.java:217) at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257) at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104) 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: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 java.lang.ClassLoader.loadClass(ClassLoader.java:307) at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:242) at org.apache.tools.ant.util.ClasspathUtils.newInstance(ClasspathUtils.java:266) ... 5 more --- Nested Exception --- 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 java.lang.ClassLoader.loadClass(ClassLoader.java:307) at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:242) at org.apache.tools.ant.util.ClasspathUtils.newInstance(ClasspathUtils.java:266) at org.apache.tools.ant.Main.addBuildListeners(Main.java:799) at org.apache.tools.ant.Main.runBuild(Main.java:681) at org.apache.tools.ant.Main.startAnt(Main.java:217) at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257) at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104) Note : build-info-api-2.0.7.jar build-info-client-2.0.7.jar build-info-extractor-2.0.7.jar build-info-vcs-2.0.7.jar => seems to be compile with jdk 1.6

    Jenkins JIRA | 5 years ago | Sébastien Heurtematte
    java.lang.UnsupportedClassVersionError: Bad version number in .class file
  2. 0

    UnsupportedClassVersionError when running build with jdk 1.5 To reproduce : Declare JDK 5 in jenkins configuration Create a job : freestyle project Configure job : with Ant/Ivy-Artifactory Integration Stacktrace : [latest] $ /usr/lib/ant/apache-ant-1.7.1/bin/ant -file build.xml livraison -v -lib /var/lib/jenkins/plugins/artifactory/WEB-INF/lib -listener org.jfrog.build.extractor.listener.ArtifactoryBuildListener Apache Ant version 1.7.1 compiled on June 27 2008 Buildfile: build.xml BUILD FAILED Class org.jfrog.build.extractor.listener.ArtifactoryBuildListener could not be loaded because of an invalid dependency. at org.apache.tools.ant.util.ClasspathUtils.newInstance(ClasspathUtils.java:296) at org.apache.tools.ant.Main.addBuildListeners(Main.java:799) at org.apache.tools.ant.Main.runBuild(Main.java:681) at org.apache.tools.ant.Main.startAnt(Main.java:217) at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257) at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104) 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: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 java.lang.ClassLoader.loadClass(ClassLoader.java:307) at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:242) at org.apache.tools.ant.util.ClasspathUtils.newInstance(ClasspathUtils.java:266) ... 5 more --- Nested Exception --- 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 java.lang.ClassLoader.loadClass(ClassLoader.java:307) at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:242) at org.apache.tools.ant.util.ClasspathUtils.newInstance(ClasspathUtils.java:266) at org.apache.tools.ant.Main.addBuildListeners(Main.java:799) at org.apache.tools.ant.Main.runBuild(Main.java:681) at org.apache.tools.ant.Main.startAnt(Main.java:217) at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257) at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104) Note : build-info-api-2.0.7.jar build-info-client-2.0.7.jar build-info-extractor-2.0.7.jar build-info-vcs-2.0.7.jar => seems to be compile with jdk 1.6

    Jenkins JIRA | 5 years ago | Sébastien Heurtematte
    java.lang.UnsupportedClassVersionError: Bad version number in .class file
  3. 0

    Java .jar not running in unix

    Stack Overflow | 5 years ago | TyC
    java.lang.UnsupportedClassVersionError: Bad version number in .class file
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    lein doesn't mention Java version requirements

    GitHub | 4 years ago | birchb1024
    java.lang.UnsupportedClassVersionError: Bad version number in .class file
  6. 0

    Java

    wpthm.com | 1 year ago
    java.lang.UnsupportedClassVersionError: Bad version number in .class file

  1. kid 4 times, last 5 months ago
19 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
    Class.forName
    1. java.lang.ClassLoader.defineClass1(Native Method)
    2. java.lang.ClassLoader.defineClass(ClassLoader.java:621)
    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)
    9. java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    10. java.lang.ClassLoader.loadClass(ClassLoader.java:252)
    11. java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
    12. java.lang.Class.forName0(Native Method)
    13. java.lang.Class.forName(Class.java:242)
    13 frames
  3. Ant
    Main.startAnt
    1. org.apache.tools.ant.util.ClasspathUtils.newInstance(ClasspathUtils.java:266)
    2. org.apache.tools.ant.Main.addBuildListeners(Main.java:799)
    3. org.apache.tools.ant.Main.runBuild(Main.java:681)
    4. org.apache.tools.ant.Main.startAnt(Main.java:217)
    4 frames
  4. Apache Ant Launcher
    Launcher.main
    1. org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
    2. org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
    2 frames