Jenkins - add JDK 11 to JDK list

JDKs can be managed with JDK Tool Plugin which usually comes pre-installed.

  • Go to "Manage Jenkins" > "Global Tool Configuration"

  • Under JDK installations click 'Add JDK'

  • Delete the default installer and add an installer of type "Extract .zip/.tar.gz"

  • Find a URL to a JDK archive in tar.gz or zip format.

OpenJDK 11 binary can be found in jdk.java.net/java-se-ri/11

This is the setting I have for openjdk-11+28

JDK name: OpenJDK-11
Label: (Keep this blank)
Download URL for binary archive: https://download.java.net/openjdk/jdk11/ri/openjdk-11+28_linux-x64_bin.tar.gz

Subdirectory of extracted archive: jdk-11

Here in my case openjdk-11+28_linux-x64_bin.tar.gz, did contain a subdirectory named jdk-11

If it's incorrectly set up you might see the error:

Error: JAVA_HOME is not defined correctly.
  We cannot execute /var/jenkins_home/tools/hudson.model.JDK/JDK-11/bin/java

I guess you are using the JDK Tool Plugin.

Click "Manage Jenkins" > "Global Tool Configuration" > "Add JDK" (near JDK installations)

Delete the java.sun.com installer. Just click "Add Installer" below and choose "Extract .zip/.tar.gz"

Enter following:

Label: openjdk-11

Download URL: https://download.java.net/java/GA/jdk11/13/GPL/openjdk-11.0.1_linux-x64_bin.tar.gz

Subdirectory of extracted archive: jdk-11.0.1 (Optional subdirectory of the downloaded and unpacked archive to use as the tool's home directory.)

And "Save" the configuration

=> Use JDK label (openjdk-11) in your build job.


The download-link given above appears to be from a time when java 11 hadn't entered LTS;

Instead go to Java Platform, Standard Edition 11 Reference Implementations which will provide you the download-link to the most recent release of the...

[...] official Reference Implementation for Java SE 11 (JSR 384) [...] based solely upon open-source code available from the JDK 11 Project in the OpenJDK Community. This Reference Implementation applies to both the Final Release of JSR 384 (Sep 2018) and Maintenance Release 1 (Mar 2019).

... which as of this writing is: https://download.java.net/openjdk/jdk11/ri/openjdk-11+28_linux-x64_bin.tar.gz