Running Jenkins with Java 10 and 11 (experimental support)
Please refer to Running Jenkins on Java 11 documentation to have the up-to-date details on how to run Jenkins on Java 11. |
Guidelines in this blogpost are rendered obsolete by the Java 11 Support Preview Availability announcement on Dec 13, 2018 and by the Java 11 GA release on Sep 25, 2018. See the Java support page for up-to-date information about running Jenkins with Java 11. The Jenkins project also no longer ships preview versions for Java 10. |
As you probably know, we will have a Jenkins and Java 10+ online hackathon this week. In order to enable early adopters to try out Jenkins with new Java versions, we have updated Jenkins core and Docker packages. Starting from Jenkins 2.127, weekly releases can be launched with Java 10 and Java 11 (preview). Although there are some known compatibility issues, the packages are ready for evaluation and exploratory testing.
This article explains how to run Jenkins with Java 10 and 11 using Docker images and WAR files. It also lists known issues and provides contributor guidelines.
Running in Docker
In order to simplify testing, we have created a new jenkins/jenkins-experimental repository on DockerHub. This repository includes various Jenkins Core images, including Java 10 and Java 11 images. We have also set up development branches and continuous delivery flows for Jenkins core, so now we can deliver patches for these images without waiting for weekly releases.
You can run the image simply as:
docker run -p 8080:8080 -p 50000:50000 jenkins/jenkins-experimental:latest-jdk11
The following tags are available:
-
2.127-jdk10
,2.128-jdk10
- Weekly releases packaged with Java 10 -
2.127-jdk11
,2.128-jdk11
- Weekly releases packaged with Java 11 -
latest-jdk10
- Jenkins core build from the java10-support branch -
latest-jdk11
- Automatic build from the core’s java11-support branch. -
blueocean-jdk10
,blueocean-jdk11
- Experimental build, which bundles all Jenkins Pipeline and Blue Ocean patches required to run on Java 11. If you want to try Pipeline, use this image
Java 10/11 images are fully compatible with the official
jenkins/jenkins
Docker image documentation,
e.g. you can use plugins.txt
to install plugins, mount volumes and pass extra options via environment variables.
Running Jenkins without Docker
Java 10
-
Download Jenkins WAR for 2.127 or above (or build the experimental branch)
-
Run WAR with the following command:
${JAVA10_HOME}/bin/java --add-modules java.xml.bind -jar jenkins.war \
--enable-future-java --httpPort=8080 --prefix=/jenkins
Java 11
-
Download Jenkins WAR for 2.127 or above (or build the experimental branch)
-
Download the following libraries to the same directory as jenkins.war
-
jaxb-api-2.3.0.jar (save as jaxb-api.jar)
-
jaxb-core-2.3.0.1.jar (save as jaxb-core.jar)
-
jaxb-impl-2.3.0.1.jar (save as jaxb-impl.jar)
-
javax.activation v.1.2.0 (save as javax.activation.jar)
-
-
Run the following command:
Run Jenkins with ${JAVA11_HOME}/bin/java \
-p jaxb-api.jar:javax.activation.jar --add-modules java.xml.bind,java.activation \
-cp jaxb-core.jar:jaxb-impl.jar \
-jar jenkins.war --enable-future-java --httpPort=8080 --prefix=/jenkins
Current state
As of June 17, we have achieved the following state:
-
Jenkins 2.127+ starts up successfully with OpenJDK 10.0.1 and OpenJDK 11+17-Debian-2 (preview)
-
It is possible to configure and run simple Freestyle jobs
-
Jenkins agents are able to start on Java 10, to connect to the master and to execute Freestyle jobs
-
Agents can be connected using Docker Plugin and Yet Another Docker Plugin
-
Job DSL plugin works well on demo projects
-
Maven Integration plugin can build plugin-pom-based Jenkins plugins when running on agents with JDK 8
-
It is possible to create Folders and manage items in them
-
It is possible to configure Jenkins using Configuration-as-Code plugin
-
Jenkins is able to execute Groovy scripts in Script Console and Groovy Hooks
Known issues
So far we know about the following issues:
-
Pipeline crashes immediately on Java 10 and 11 (JENKINS-46602)
-
Workaround: Pipeline: Support plugin should be updated to version 3.0-java11-alpha-1-rc684.d802f5d9aeed from the Incrementals repo (download)
-
-
FIXED - Git Client plugin 2.7.2 cannot be installed when running with Java 11 build 18ea
-
There are many warnings about Illegal reflective access during execution (linked in JENKINS-40689).
-
In current Java 10 and 11 releases it does not lead to failures, but we want to cleanup these warnings anyway
-
-
FIXED - Configuration-as-Code plugin fails to export configurations on Java 10 (JENKINS-51991)
We anticipate to discover and report more issues during the hackathon this week.
Contributing
If you discover incompatibilities in plugins, please
report issues in our bugtracker.
We have java10
and java11
labels for such issues.
If you are interested to try out Jenkins with Java 10 and 11 before June 22nd,
you may be interested to sign-up to the Jenkins and Java 10+ online hackathon.
Everybody is welcome to join, independently of their Jenkins experience and amount of time they have available.
Exploratory testing is also within the hackathon’s scope.
During this event, please also use the java10_hackathon
label.
It will help us to track contributions and send folks some small "thank you" gifts for participating (details will be figured out during the hackathon).
If you want to contribute patches to the core,
please submit pull requests to java10-support or
java11-support branches.
If the patches are compatible with Java 8, we will try to upstream them to weekly releases.
For plugin patches please create pull requests against main branches and then follow guidelines from plugin maintainers.
If you need additional reviews and you are a member of the jenkinsci
organization,
feel free to mention the @jenkinsci/java10-support
team in your PRs.