On Windows 10, after configuring under Global Tool Configuration a new JDK installation called "JDK-1.8" and selecting Install automatically (I selected Java SE Development Kit 8u77 in the combo box) and running the following pipeline code

      node {
        git url: 'https://github.com/jglick/simple-maven-project-with-tests.git'
        def mvnHome = tool 'M3'
        tool 'JDK-1.8'
        bat "\"${mvnHome}\"\\bin\\mvn -B verify"
      }
      

      I get this error:

      [Pipeline] Allocate node : Start
      Running on master in C:\Program Files (x86)\Jenkins\workspace\myPipeline
      [Pipeline] node {
      [Pipeline] git
      Fetching changes from the remote Git repository
      Checking out Revision 7dac409d4bd2fec35a4ccde0cb424042cba671df (refs/remotes/origin/master)
      [Pipeline] tool
      [Pipeline] tool
      Installing JDK jdk-8u77-oth-JPR
      Downloading JDK from http://download.oracle.com/otn-pub/java/jdk/8u77-b03/jdk-8u77-windows-i586.exe
      Downloading 190848568 bytes
      Installing C:\Program Files (x86)\Jenkins\tools\hudson.model.JDK\JDK-1.8\jdk.exe
      [JDK-1.8] $ "C:\Program Files (x86)\Jenkins\tools\hudson.model.JDK\JDK-1.8\jdk.exe" /s ADDLOCAL="ToolsFeature" REBOOT=ReallySuppress "INSTALLDIR=C:\Program Files (x86)\Jenkins\tools\hudson.model.JDK\JDK-1.8" /L "C:\Program Files (x86)\Jenkins\tools\hudson.model.JDK\install6891913520880051828log"
      Failed to install JDK. Exit code=1 619
      [Pipeline] } //node
      [Pipeline] Allocate node : End
      [Pipeline] End of Pipeline
      ERROR: null
      Finished: FAILURE
      

          [JENKINS-34012] Fail to automatically install JDK 1.8.0_77

          Laurent TOURREAU created issue -
          Laurent TOURREAU made changes -
          Description Original: On Windows 10, after configuring under Global Tool Configuration a new JDK installation called "JDK-1.8" and selecting _Install automatically_ (I selected _Java SE Development Kit 8u77_ in the combo box) and running the following pipeline code
          {code}
          node {
            git url: 'https://github.com/jglick/simple-maven-project-with-tests.git'
            def mvnHome = tool 'M3'
            tool 'JDK-1.8'
            bat "\"${mvnHome}\"\\bin\\mvn -B verify"
          }
          {code}

          {code}
          [Pipeline] Allocate node : Start
          Running on master in C:\Program Files (x86)\Jenkins\workspace\myPipeline
          [Pipeline] node {
          [Pipeline] git
          Fetching changes from the remote Git repository
          Checking out Revision 7dac409d4bd2fec35a4ccde0cb424042cba671df (refs/remotes/origin/master)
          [Pipeline] tool
          [Pipeline] tool
          Installing JDK jdk-8u77-oth-JPR
          Downloading JDK from http://download.oracle.com/otn-pub/java/jdk/8u77-b03/jdk-8u77-windows-i586.exe
          Downloading 190848568 bytes
          Installing C:\Program Files (x86)\Jenkins\tools\hudson.model.JDK\JDK-1.8\jdk.exe
          [JDK-1.8] $ "C:\Program Files (x86)\Jenkins\tools\hudson.model.JDK\JDK-1.8\jdk.exe" /s ADDLOCAL="ToolsFeature" REBOOT=ReallySuppress "INSTALLDIR=C:\Program Files (x86)\Jenkins\tools\hudson.model.JDK\JDK-1.8" /L "C:\Program Files (x86)\Jenkins\tools\hudson.model.JDK\install6891913520880051828log"
          Failed to install JDK. Exit code=1 619
          [Pipeline] } //node
          [Pipeline] Allocate node : End
          [Pipeline] End of Pipeline
          ERROR: null
          Finished: FAILURE
          {code}
          New: On Windows 10, after configuring under Global Tool Configuration a new JDK installation called "JDK-1.8" and selecting _Install automatically_ (I selected _Java SE Development Kit 8u77_ in the combo box) and running the following pipeline code
          {code}
          node {
            git url: 'https://github.com/jglick/simple-maven-project-with-tests.git'
            def mvnHome = tool 'M3'
            tool 'JDK-1.8'
            bat "\"${mvnHome}\"\\bin\\mvn -B verify"
          }
          {code}

          I get this error:
          {code}
          [Pipeline] Allocate node : Start
          Running on master in C:\Program Files (x86)\Jenkins\workspace\myPipeline
          [Pipeline] node {
          [Pipeline] git
          Fetching changes from the remote Git repository
          Checking out Revision 7dac409d4bd2fec35a4ccde0cb424042cba671df (refs/remotes/origin/master)
          [Pipeline] tool
          [Pipeline] tool
          Installing JDK jdk-8u77-oth-JPR
          Downloading JDK from http://download.oracle.com/otn-pub/java/jdk/8u77-b03/jdk-8u77-windows-i586.exe
          Downloading 190848568 bytes
          Installing C:\Program Files (x86)\Jenkins\tools\hudson.model.JDK\JDK-1.8\jdk.exe
          [JDK-1.8] $ "C:\Program Files (x86)\Jenkins\tools\hudson.model.JDK\JDK-1.8\jdk.exe" /s ADDLOCAL="ToolsFeature" REBOOT=ReallySuppress "INSTALLDIR=C:\Program Files (x86)\Jenkins\tools\hudson.model.JDK\JDK-1.8" /L "C:\Program Files (x86)\Jenkins\tools\hudson.model.JDK\install6891913520880051828log"
          Failed to install JDK. Exit code=1 619
          [Pipeline] } //node
          [Pipeline] Allocate node : End
          [Pipeline] End of Pipeline
          ERROR: null
          Finished: FAILURE
          {code}

          Daniel Beck added a comment -

          Could this be JENKINS-23366?

          Daniel Beck added a comment - Could this be JENKINS-23366 ?

          Not sure : exit code is not the same (Exit code=-80) and i don't have any slave node configured. I only use the master here.

          Laurent TOURREAU added a comment - Not sure : exit code is not the same (Exit code=-80) and i don't have any slave node configured. I only use the master here.

          Jesse Glick added a comment -

          The tool step merely ensures that the tool is present. Its return value is the path. If you want to set environment variables, that is up to you. JENKINS-28718 would help automate it.

          Jesse Glick added a comment - The tool step merely ensures that the tool is present. Its return value is the path. If you want to set environment variables, that is up to you. JENKINS-28718 would help automate it.
          Jesse Glick made changes -
          Link New: This issue is related to JENKINS-28718 [ JENKINS-28718 ]
          Jesse Glick made changes -
          Resolution New: Not A Defect [ 7 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]

          Jesse Glick added a comment -

          Never mind. The script is wrong, but that is not the error being reported here.

          Jesse Glick added a comment - Never mind. The script is wrong, but that is not the error being reported here.
          Jesse Glick made changes -
          Resolution Original: Not A Defect [ 7 ]
          Status Original: Resolved [ 5 ] New: Reopened [ 4 ]
          Jesse Glick made changes -
          Link New: This issue is related to JENKINS-23366 [ JENKINS-23366 ]

            Unassigned Unassigned
            lautou Laurent TOURREAU
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: