Issue
Using the Jenkins JDK Tool Installer fails when trying to download a previous version of Java. The failure is caused by Oracle’s update of their website. This update breaks the form functionality that is a part of Jenkins core that is responsible for automating the authentication requirement on Oracle’s website.
The console output shows a stack trace similar to:
14:15:21 Installing JDK jdk-8u121-oth-JPR 14:15:21 Downloading JDK from https://download.oracle.com/otn/java/jdk/8u121-b13/e9e7ea248e2c4826b92b3f075a80e441/jdk-8u121-linux-x64.tar.gz 14:15:29 java.io.IOException: Unable to find the login form 14:15:29 at hudson.tools.JDKInstaller.locate(JDKInstaller.java:464) 14:15:29 at hudson.tools.JDKInstaller.performInstallation(JDKInstaller.java:139) 14:15:29 at hudson.tools.InstallerTranslator.getToolHome(InstallerTranslator.java:72) 14:15:29 at hudson.tools.ToolLocationNodeProperty.getToolHome(ToolLocationNodeProperty.java:109) 14:15:29 at hudson.tools.ToolInstallation.translateFor(ToolInstallation.java:206) 14:15:29 at hudson.model.JDK.forNode(JDK.java:144) 14:15:29 at hudson.model.AbstractProject.getEnvironment(AbstractProject.java:341)
The Jenkins community is tracking this issue as JENKINS-47448 .
Resolution
There are two options:
-
Using the Jenkins JDK Tool Installer to install the most recent version of Java will work as expected since it does not require authentication.
-
If you need a previous version of Java the quickest workaround is to manually install the Java JDK version that is needed on your agents or in your jobs.
The full Java JDK is recommended because it contains additional utilities that are required to generate diagnostic data in the event there are issues with the specific Java process.