Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-47280

Jenkins unable to build Maven projects with JDKs older than JDK 1.8

    Details

    • Similar Issues:

      Description

      The project is setup with Maven 3.3.2 and JDK 1.6. It seems the Jenkins agent jar was built using JDK 1.8.

      Jenkins should be able to build projects in older JDKs even though Jenkins itself is using JDK 1.8

      Marked as "blocker" because I cannot find a workaround at this time, please adjust accordingly if not correct.

      Possibly related to: 

      Parsing POMs
      Modules changed, recalculating dependency graph
      Established TCP socket on 40120
      Copied maven32-agent.jar
      Copied maven32-interceptor.jar
      Copied maven3-interceptor-commons.jar
      [tomitribe-tomee] $ /usr/lib/jvm/java-6-oracle/bin/java -Xmx12g -XX:MaxPermSize=512m -Dhttps.protocols=TLSv1.1,TLSv1.2 -cp /home/ubuntu/maven32-agent.jar:/home/ubuntu/tools/hudson.tasks.Maven_MavenInstallation/maven-3.2.5/boot/plexus-classworlds-2.5.2.jar:/home/ubuntu/tools/hudson.tasks.Maven_MavenInstallation/maven-3.2.5/conf/logging jenkins.maven3.agent.Maven32Main /home/ubuntu/tools/hudson.tasks.Maven_MavenInstallation/maven-3.2.5 /tmp/slave.jar /home/ubuntu/maven32-interceptor.jar /home/ubuntu/maven3-interceptor-commons.jar 40120
      Exception in thread "main" java.lang.UnsupportedClassVersionError: jenkins/maven3/agent/Maven32Main : Unsupported major.minor version 51.0
      at java.lang.ClassLoader.defineClass1(Native Method)
      at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
      at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
      at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
      at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
      at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
      Could not find the main class: jenkins.maven3.agent.Maven32Main. Program will exit.
      ERROR: Failed to launch Maven. Exit code = 1

        Attachments

          Issue Links

            Activity

            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            There is no workaround for that, you would have to invoke Maven from script steps or from Maven Pipeline Plugin.

            The behavior is explicitly documented in plugin Wiki. I will find whether it's duplicate or not, but it's definitely not a bug. Just a huge architecture issue

            Show
            oleg_nenashev Oleg Nenashev added a comment - There is no workaround for that, you would have to invoke Maven from script steps or from Maven Pipeline Plugin. The behavior is explicitly documented in plugin Wiki. I will find whether it's duplicate or not, but it's definitely not a bug. Just a huge architecture issue
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            Closing as a duplicate of JENKINS-44703 for now

            Show
            oleg_nenashev Oleg Nenashev added a comment - Closing as a duplicate of JENKINS-44703 for now

              People

              • Assignee:
                Unassigned
                Reporter:
                exabrial Jonathan Fisher
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: