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

slave.jar compiled against jdk11 wich makes it incompatible for maven job which use jdk8

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Blocker Blocker
    • core, maven-plugin, remoting
    • None
    • Jenkins 2.361.1 LTS
      Master and slaves running on Windows
      remoting version 3044.vb_940a_a_e4f72e
      nodes and master running with zulu jdk11 (zulu11.56.19-ca-jdk11.0.15-win_x64)

      After switch LTS version from 2.346.3 to LTS 2.361.1 the slave.jar was updated and distributed to all slaves.

      But with the latest version, all maven jobs are failing with "Incompatible class version" error. All jobs defined to use jdk8 (which is a job definition).

      It seems the slave.jar comes into place, when maven goal is triggered. The maven installation is not used (which works well with jdk8) but instead jenkins uses the maven plugin which creates a command line where the slave.jar is involved. When this commandline is triggered, the jdk from the job is used (in my case jdk8) to start the maven goal.

      *08:42:08* Established TCP socket on 55103 *08:42:08* maven35-agent.jar already up to date *08:42:08* maven35-interceptor.jar already up to date *08:42:08* maven3-interceptor-commons.jar already up to date *08:42:08* [portal-webapp] $ D:\applications\prg\java\jdk8x64/bin/java -Xms256m -Xmx2048m -Xrs -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -Djava.awt.headless=true -cp D:\applications\prg\jenkinsSlave1\maven35-agent.jar;D:\applications\prg\ApacheMaven\current-maven\boot\plexus-classworlds-2.6.0.jar;D:\applications\prg\ApacheMaven\current-maven/conf/logging jenkins.maven3.agent.Maven35Main D:\applications\prg\ApacheMaven\current-maven D:\applications\prg\jenkinsSlave1\slave.jar D:\applications\prg\jenkinsSlave1\maven35-interceptor.jar D:\applications\prg\jenkinsSlave1\maven3-interceptor-commons.jar 55103
       
      *08:42:09* Exception in thread "main" java.lang.UnsupportedClassVersionError: hudson/remoting/Launcher has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0 *08:42:09*  at java.lang.ClassLoader.defineClass1(Native Method) *08:42:09*  at java.lang.ClassLoader.defineClass(ClassLoader.java:757) *08:42:09*  at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) *08:42:09*  at java.net.URLClassLoader.defineClass(URLClassLoader.java:473) *08:42:09*  at java.net.URLClassLoader.access$100(URLClassLoader.java:74) *08:42:09*  at java.net.URLClassLoader$1.run(URLClassLoader.java:369) *08:42:09*  at java.net.URLClassLoader$1.run(URLClassLoader.java:363) *08:42:09*  at java.security.AccessController.doPrivileged(Native Method) *08:42:09*  at java.net.URLClassLoader.findClass(URLClassLoader.java:362) *08:42:09*  at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClassFromSelf(ClassRealm.java:425) *08:42:09*  at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:42) *08:42:09*  at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:271) *08:42:09*  at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:247) *08:42:09*  at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:239) *08:42:09*  at jenkins.maven3.agent.Maven35Main.main(Maven35Main.java:135) *08:42:09*  at jenkins.maven3.agent.Maven35Main.main(Maven35Main.java:65) *08:42:09* ERROR: Failed to parse POMs *08:42:09* java.io.EOFException: unexpected stream termination *08:42:09*  at hudson.remoting.ChannelBuilder.negotiate(ChannelBuilder.java:459) *08:42:09*  at hudson.remoting.ChannelBuilder.build(ChannelBuilder.java:404) *08:42:09*  at hudson.slaves.Channels.forProcess(Channels.java:121) *08:42:09*  at hudson.maven.AbstractMavenProcessFactory.newProcess(AbstractMavenProcessFactory.java:296) *08:42:09*  at hudson.maven.ProcessCache.get(ProcessCache.java:236) *08:42:09*  at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:802) *08:42:09*  at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:524) *08:42:09*  at hudson.model.Run.execute(Run.java:1899) *08:42:09*  at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:543) *08:42:09*  at hudson.model.ResourceController.execute(ResourceController.java:107) *08:42:09*  at hudson.model.Executor.run(Executor.java:449)
      

      When using jdk11 in job definition, it works but now we need to change all applications to be jdk11 ready when compiling with maven (for example include javax.* stuff because of the drop-off from jdk11).

      For me this breaks the sense of a maven job, where I can define a jdk to be used for compilation and runtime, but then jdk11 is a minimum requirement.

      Question: would it be possible to use a earlier version of the slave.jar with the new jenkins version to still be able to run our jobs?

      Hope there is a fix available to be not locked into jdk11 when using maven-jobs. This issue really breaks all of our builds. Thats why I set this to blocker because we are unable to change all of our projects (> 100) to be jdk11 ready ... and we relay on maven so in the current situation, jenkins is not useable anymore.

      Thanks for your help
      -Waffel

            jthompson Jeff Thompson
            waffel Thomas Wabner
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: