Search code examples
jenkinsjenkins-pipeline

How to configure jdk11 in jenkins v1.656?


I want some help to configure jdk11 in jenkins v1.656. I added an installer in "Global configuration" which points to below url for "Download URL for binary archive"

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

When i try to build the job using jdk11 i get the connection timeout exception. See below.

ERROR: Failed to download https://download.java.net/java/GA/jdk11/13/GPL/openjdk-11.0.1_linux-x64_bin.tar.gz from slave; 

java.net.ConnectException: Connection timed out

Can someone help what other ways i can follow to add jdk11 to the jdk list in jenkins?


Solution

  • The last Jenkins 1.x release was 2016-06-08. JDK11 GA was released 2018-09-25, so I would not expect smooth sailing

    However, you issue is not so much running Jenkins under Java 11, rather attempting to install Java 11 as a Tool for jobs to use, which is an independent thing. Never tested that jump as not using Java 11 on our platform, but should be similar to this.

    I will guess you simply don't have a proxy connection to get out to pull from java.net. Confirm from controller OS by doing a wget , then confgure http_proxy.

    I would though recommend moving to the latest Jenkins 2.x LTS release - 2.303.1+, which is fully Java 11 compatible and the default for Docker image is also now 11. 1.x has security vulnerabilities and 2.x is just so much more polished and better, especially w/pipelines and more plugins.

    Mind you, you don't really want to use the GA reference release, rather some OpenJDK implementation, like hotspot/Adoptium. ApodtOpenJDK installer may help.