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

Build is running with wrong JDK Version

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Blocker
    • Resolution: Not A Defect
    • maven-plugin
    • None
    • Jenkins 1.612
      Linux machine.

    Description

      We have configured Jenkins to run with Java 1.7 JDK but run our build with IBM Java (1.6)

      00:03:38.459 [Release] $ /opt/build/tools/jdk/java-1.6-pxa6460_26sr2fp1-20120622_01/bin/java -Xmx2048m -XX:MaxPermSize=1024m -cp /opt/build/jenkins/plugins/maven-plugin/WEB-INF/lib/maven31-agent-1.6.jar:/opt/build/tools/apache-maven-3.1.1/boot/plexus-classworlds-2.5.1.jar:/opt/build/tools/apache-maven-3.1.1/conf/logging jenkins.maven3.agent.Maven31Main /opt/build/tools/apache-maven-3.1.1 /opt/build/jenkins/war/WEB-INF/lib/remoting-2.51.jar /opt/build/jenkins/plugins/maven-plugin/WEB-INF/lib/maven31-interceptor-1.6.jar /opt/build/jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-commons-1.6.jar 38701
      00:03:39.181 <===[JENKINS REMOTING CAPACITY]===>channel started
      *00:03:40.315 ERROR: JENKINS-18403 JDK 5 not supported to run Maven; retrying with slave Java and setting compile/test properties to point to /opt/build/tools/jdk/java-1.6-pxa6460_26sr2fp1-20120622_01*00:03:40.315 [Release] $ /opt/build/tools/jdk/jdk-1.7.0_60/jre/bin/java -Xmx2048m -XX:MaxPermSize=1024m -cp /opt/build/jenkins/plugins/maven-plugin/WEB-INF/lib/maven31-agent-1.6.jar:/opt/build/tools/apache-maven-3.1.1/boot/plexus-classworlds-2.5.1.jar:/opt/build/tools/apache-maven-3.1.1/conf/logging jenkins.maven3.agent.Maven31Main /opt/build/tools/apache-maven-3.1.1 /opt/build/jenkins/war/WEB-INF/lib/remoting-2.51.jar /opt/build/jenkins/plugins/maven-plugin/WEB-INF/lib/maven31-interceptor-1.6.jar /opt/build/jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-commons-1.6.jar 52333
      00:03:41.025 <===[JENKINS REMOTING CAPACITY]===>channel started
      00:03:42.778 using settings config with name nexus-nxccbd01
      00:03:45.723 Executing Maven: -B -f /release/pom.xml -Dmaven.repo.local=/release/.repository -s /tmp/settings1945838439514897012.xml -T4.0 --fail-at-end -U clean deploy

      But it looks like the build is now being run with Java 1.7 instead which is not working.

      Attachments

        Activity

          danielbeck Daniel Beck added a comment -

          Maven jobs, due to their tight integration with Jenkins, absolutely cannot build with a JDK not able to run Jenkins itself. So 1.6 builds are out unless you downgrade Jenkins, or move to using freestyle jobs. This is by design.

          What's left is the wrong log text (there's an issue for it), and the automatic retry which may be undesirable.

          danielbeck Daniel Beck added a comment - Maven jobs, due to their tight integration with Jenkins, absolutely cannot build with a JDK not able to run Jenkins itself. So 1.6 builds are out unless you downgrade Jenkins, or move to using freestyle jobs. This is by design. What's left is the wrong log text (there's an issue for it), and the automatic retry which may be undesirable.

          But the problem is that i had run Jenkins (1.601) already with Java 7 and my builds with JDK 6 (IBM to be more accurate) which worked without any problem. But the issue i have observed was that after the update to 1.612 it does not work anymore. The JDK which Jenkins is running with and the one which used for my builds has not changed. So either there was a issue before and there has been introduced a new issue..?
          As you can see the line which shows the maven part is running with Java 1.6 IBM and NOT with Java 1.7 where Jenkins is running with...

           /opt/build/tools/jdk/java-1.6-pxa6460_26sr2fp1-20120622_01/bin/java -Xmx2048m -XX:MaxPermSize=1024m -cp /opt/build/jenkins/plugins/maven-plugin/WEB-INF/lib/maven31-agent-1.6.jar:/opt/build/tools/apache-maven-3.1.1/boot/plexus-classworlds-2.5.1.jar:/opt/build/tools/apache-maven-3.1.1/conf/logging jenkins.maven3.agent.Maven31Main /opt/build/tools/apache-maven-3.1.1 /opt/build/jenkins/war/WEB-INF/lib/remoting-2.51.jar /opt/build/jenkins/plugins/maven-plugin/WEB-INF/lib/maven31-interceptor-1.6.jar /opt/build/jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-commons-1.6.jar 38701
          
          khmarbaise Karl-Heinz Marbaise added a comment - But the problem is that i had run Jenkins (1.601) already with Java 7 and my builds with JDK 6 (IBM to be more accurate) which worked without any problem. But the issue i have observed was that after the update to 1.612 it does not work anymore. The JDK which Jenkins is running with and the one which used for my builds has not changed. So either there was a issue before and there has been introduced a new issue..? As you can see the line which shows the maven part is running with Java 1.6 IBM and NOT with Java 1.7 where Jenkins is running with... /opt/build/tools/jdk/java-1.6-pxa6460_26sr2fp1-20120622_01/bin/java -Xmx2048m -XX:MaxPermSize=1024m -cp /opt/build/jenkins/plugins/maven-plugin/WEB-INF/lib/maven31-agent-1.6.jar:/opt/build/tools/apache-maven-3.1.1/boot/plexus-classworlds-2.5.1.jar:/opt/build/tools/apache-maven-3.1.1/conf/logging jenkins.maven3.agent.Maven31Main /opt/build/tools/apache-maven-3.1.1 /opt/build/jenkins/war/WEB-INF/lib/remoting-2.51.jar /opt/build/jenkins/plugins/maven-plugin/WEB-INF/lib/maven31-interceptor-1.6.jar /opt/build/jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-commons-1.6.jar 38701
          danielbeck Daniel Beck added a comment -

          But the problem is that i had run Jenkins (1.601) already with Java 7 and my builds with JDK 6 (IBM to be more accurate) which worked without any problem.

          Jenkins 1.612 started requiring Java 7 (changelog). Which is why I wrote that the JDK used to compile a Maven project needs to be able to run Jenkins, which JDK 6 no longer does. I asked Kohsuke today, this is inherent in the design of the Maven Project Plugin, and cannot be changed.

          danielbeck Daniel Beck added a comment - But the problem is that i had run Jenkins (1.601) already with Java 7 and my builds with JDK 6 (IBM to be more accurate) which worked without any problem. Jenkins 1.612 started requiring Java 7 ( changelog ). Which is why I wrote that the JDK used to compile a Maven project needs to be able to run Jenkins, which JDK 6 no longer does. I asked Kohsuke today, this is inherent in the design of the Maven Project Plugin, and cannot be changed.

          Ah Ok..than i know for sure. Wishes from London JUC.

          khmarbaise Karl-Heinz Marbaise added a comment - Ah Ok..than i know for sure. Wishes from London JUC.

          Based on the explanations this is simply an evolvement of Jenkins.

          khmarbaise Karl-Heinz Marbaise added a comment - Based on the explanations this is simply an evolvement of Jenkins.

          I want to be sure I understand what is being said.

          If we configure a Jenkins job as a maven project, the JDK used to run maven compiles must be at least JDK 1.7 required to run Jenkins.

          If we configure the job as a freestyle job, and execute a maven build step, the JDK used for the job may be JDK 1.6.

          What about toolchains? It seems that the whole point of maven toolchains is to allow maven-compiler-plugin to use a different JDK than the one running maven itself. Should we be able to configure the job as a maven project, building in JDK 1.7 or even 1.8, and using toolchains mechanism, specify the JDK 1.6 path for the maven-compiler-plugin? This seems like it should be the advice.

          michael_giroux michael giroux added a comment - I want to be sure I understand what is being said. If we configure a Jenkins job as a maven project, the JDK used to run maven compiles must be at least JDK 1.7 required to run Jenkins. If we configure the job as a freestyle job, and execute a maven build step, the JDK used for the job may be JDK 1.6. What about toolchains? It seems that the whole point of maven toolchains is to allow maven-compiler-plugin to use a different JDK than the one running maven itself. Should we be able to configure the job as a maven project, building in JDK 1.7 or even 1.8, and using toolchains mechanism, specify the JDK 1.6 path for the maven-compiler-plugin? This seems like it should be the advice.
          danielbeck Daniel Beck added a comment -

          What about toolchains?

          I've been told toolchains are the solution and should work.

          danielbeck Daniel Beck added a comment - What about toolchains? I've been told toolchains are the solution and should work.
          michael_giroux michael giroux added a comment - For more about toolchains see https://maven.apache.org/guides/mini/guide-using-toolchains.html

          People

            khmarbaise Karl-Heinz Marbaise
            khmarbaise Karl-Heinz Marbaise
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: