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

Global tool JDK 11.0.12 causes "java.util.zip.ZipException: archive is not a ZIP archive" at pipeline download/unzip

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      The exception below is thrown when defining a global tool JDK 11.0.12 with

      URL: https://download.oracle.com/otn/java/jdk/11.0.12%2B8/f411702ca7704a54a79ead0c2e0942a3/jdk-11.0.12_windows-x64_bin.zip

      and with:

          bat 'java --version'
      
      java 16.0.2 2021-07-20
      Java(TM) SE Runtime Environment (build 16.0.2+7-67)
      Java HotSpot(TM) 64-Bit Server VM (build 16.0.2+7-67, mixed mode, sharing)
      

      and also with:

      java 11.0.12 2021-07-20 LTS
      Java(TM) SE Runtime Environment 18.9 (build 11.0.12+8-LTS-237)
      Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.12+8-LTS-237, mixed mode)
      

       and a pipeline script with:

          tools {
              jdk 'JDK 11.0.12'
          }
      
      [Pipeline] { (Declarative: Tool Install)
      [Pipeline] tool
      Unpacking https://download.oracle.com/otn/java/jdk/11.0.12%2B8/f411702ca7704a54a79ead0c2e0942a3/jdk-11.0.12_windows-x64_bin.zip to C:\Users\jenkins\AppData\Local\Jenkins\.jenkins\tools\hudson.model.JDK\JDK_11.0.12 on Jenkins
      [Pipeline] }
      [Pipeline] // stage
      [Pipeline] }
      [Pipeline] // withEnv
      [Pipeline] }
      [Pipeline] // node
      [Pipeline] End of Pipeline
      java.util.zip.ZipException: archive is not a ZIP archive
      	at org.apache.tools.zip.ZipFile.positionAtEndOfCentralDirectoryRecord(ZipFile.java:780)
      	at org.apache.tools.zip.ZipFile.positionAtCentralDirectory(ZipFile.java:716)
      	at org.apache.tools.zip.ZipFile.populateFromCentralDirectory(ZipFile.java:461)
      	at org.apache.tools.zip.ZipFile.<init>(ZipFile.java:217)
      	at org.apache.tools.zip.ZipFile.<init>(ZipFile.java:192)
      	at org.apache.tools.zip.ZipFile.<init>(ZipFile.java:152)
      	at hudson.FilePath.unzip(FilePath.java:692)
      	at hudson.FilePath.unzip(FilePath.java:683)
      	at hudson.FilePath.access$200(FilePath.java:215)
      	at hudson.FilePath$UnzipFrom.invoke(FilePath.java:672)
      	at hudson.FilePath$UnzipFrom.invoke(FilePath.java:665)
      	at hudson.FilePath.act(FilePath.java:1165)
      	at hudson.FilePath.act(FilePath.java:1148)
      	at hudson.FilePath.unzipFrom(FilePath.java:663)
      	at hudson.FilePath.installIfNecessaryFrom(FilePath.java:1017)
      Caused: java.io.IOException: Failed to unpack https://download.oracle.com/otn/java/jdk/11.0.12%2B8/f411702ca7704a54a79ead0c2e0942a3/jdk-11.0.12_windows-x64_bin.zip (4185 bytes read of total 4194)
      	at hudson.FilePath.installIfNecessaryFrom(FilePath.java:1021)
      Caused: java.io.IOException: Failed to install https://download.oracle.com/otn/java/jdk/11.0.12%2B8/f411702ca7704a54a79ead0c2e0942a3/jdk-11.0.12_windows-x64_bin.zip to C:\Users\jenkins\AppData\Local\Jenkins\.jenkins\tools\hudson.model.JDK\JDK_11.0.12
      	at hudson.FilePath.installIfNecessaryFrom(FilePath.java:1027)
      	at hudson.FilePath.installIfNecessaryFrom(FilePath.java:940)
      	at hudson.tools.ZipExtractionInstaller.performInstallation(ZipExtractionInstaller.java:83)
      	at hudson.tools.InstallerTranslator.getToolHome(InstallerTranslator.java:69)
      	at hudson.tools.ToolLocationNodeProperty.getToolHome(ToolLocationNodeProperty.java:109)
      	at hudson.tools.ToolInstallation.translateFor(ToolInstallation.java:217)
      	at hudson.model.JDK.forNode(JDK.java:148)
      	at hudson.model.JDK.forNode(JDK.java:60)
      	at org.jenkinsci.plugins.workflow.steps.ToolStep$Execution.run(ToolStep.java:155)
      	at org.jenkinsci.plugins.workflow.steps.ToolStep$Execution.run(ToolStep.java:136)
      	at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
      	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
      	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
      	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
      	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
      	at java.base/java.lang.Thread.run(Thread.java:834)
      Finished: FAILURE
      

        Attachments

          Activity

          Hide
          markewaite Mark Waite added a comment - - edited

          The download link you've provided is not a valid download link for me. When I download https://download.oracle.com/otn/java/jdk/11.0.12%2B8/f411702ca7704a54a79ead0c2e0942a3/jdk-11.0.12_windows-x64_bin.zip the resulting file is an HTML file that mentions that I must login in order to use the Oracle JDK.

          You have several alternatives.

          Show
          markewaite Mark Waite added a comment - - edited The download link you've provided is not a valid download link for me. When I download https://download.oracle.com/otn/java/jdk/11.0.12%2B8/f411702ca7704a54a79ead0c2e0942a3/jdk-11.0.12_windows-x64_bin.zip the resulting file is an HTML file that mentions that I must login in order to use the Oracle JDK. You have several alternatives. Download the JDK of your choice and host it on a local server as recommended in the plugin documentation at https://plugins.jenkins.io/jdk-tool/ If you need Java 11.0.12 but are willing to accept it from another supplier, you can use Eclipse Temurin (like the Jenkins project uses) from Adoptium.net. See https://adoptium.net/ If you need Java 11.0.12 but are interested in other suppliers, you can use Red Hat OpenJDK https://developers.redhat.com/products/openjdk/download Alternately, you could choose the OpenJDK build from Amazon Corretto at https://docs.aws.amazon.com/corretto/latest/corretto-11-ug/what-is-corretto-11.html Other free providers are listed at https://www.pentalog.com/blog/java/java-versions-distributions-platforms

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            geri Gerold Broser
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: