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

Oracle JDK tool install fails to download JDK 8u221

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Trivial Trivial
    • jdk-tool-plugin
    • None

      When the Oracle Java SE Development Kit Installer plugin is configured, it offers a pick list of outdated and unsupported Java versions. The most recent Java versions offered are Java 9.0.4 and Java 8u221.

      Attempting to install one of those outdated versions will fail the build job with a message:

      Installing JDK jdk-8u221-oth-JPR
      Downloading JDK from https://download.oracle.com/otn/java/jdk/8u221-b11/230deb18db3e4014bb8e3e8324f81b43/jdk-8u221-linux-x64.tar.gz
      Downloading -1 bytes
      Installing /home/mwaite/bugs/JENKINS-72787/tools/hudson.model.JDK/jdk8-221/jdk.sh
      [jdk8-221] $ /home/mwaite/bugs/JENKINS-72787/tools/hudson.model.JDK/jdk8-221/jdk.sh -noregister
      /home/mwaite/bugs/JENKINS-72787/tools/hudson.model.JDK/jdk8-221/jdk.sh: 2: Syntax error: newline unexpected
      FATAL: command execution failed
      hudson.AbortException: Failed to install JDK. Exit code=2
      

      The Jenkins log also includes the message:

      2024-03-07 10:09:31.839+0000 [id=56]    WARNING o.a.h.c.p.ResponseProcessCookies#processCookies: Invalid cookie header: "Set-Cookie: ak_bmsc=9gnFWQ5soI16MMkvy3fx+MZVLajQA41ogpM7Cj; Domain=.oracle.com; Path=/; Expires=Thu, 07 Mar 2024 12:09:31 GMT; Max-Age=7200; HttpOnly". Invalid 'expires' attribute: Thu, 07 Mar 2024 12:09:31 GMT
      

      The plugin fails to download the compressed tar file and thus cannot install it.

      Workaround

      Users that want to use Oracle JDK should follow the guidelines in the plugin documentation where it says:

      The recommended approach is to download the JDK distribution using other installers, for example downloading it from a well known URL (preferably hosted on your own network) with ZIP Tool Installer, having it pre-installed in agent docker images, or executing a script to do the job. If an external download is needed due to any reason, AdoptOpenJDK Plugin might be used instead of this plugin.

      Long term outlook

      Jenkins stopped supporting the controller and the agents on Java 8 in September 2022 with Jenkins 2.361.4 . Oracle Java licensing did not allow use of Oracle Java 11 without purchase of a Java license from Oracle.

      The Oracle Java SE Development Kit Installer plugin warns the user that Oracle Java requires a license. It says:

      Oracle Java SE 11+ is not available for business, commercial or production use without a commercial license. Public updates for Oracle Java SE 8 released after January 2019 will not be available for business, commercial or production use without a commercial license.

      Updating the Oracle Java SE Development Kit Installer plugin

      The Oracle Java licensing FAQ as of 7 Mar 2024 includes multiple license levels that might allow the Oracle Java SE Development Kit Installer plugin to download some of the more recent Oracle Java releases.

      It would require updates to the plugin and updates to the crawler. Those changes seem unlikely because most Jenkins users have switched from the Oracle JDK to freely available JDK implementations like Eclipse Temurin (included in the Jenkins container images), Red Hat build of OpenJDK, Amazon Corretto, Microsoft build of OpenJDK, Azul Systems OpenJDK, or Bellsoft Liberica JDK.

            Unassigned Unassigned
            vaseem vaseem
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: