In order to upgrade the JVM used to run Jenkins, more specifically from Java 8 to Java 11, there are a few details and steps to take care.
If you’re upgrading the JVM used to run Jenkins, and particularly if you’re upgrading from Java 8 to Java 11, there are some details you should know and precautions you should take.
As with any upgrade, we recommend backing up
JENKINS_HOME and testing the upgrade with the backup before performing the upgrade on your production instance.
|In production environments, you should use only LTS versions of Jenkins. Java 11 support was first included in a Long Term Support release beginning with Jenkins 2.164.1. All Jenkins LTS versions since 2.164.1 support Java 11.|
If you need to upgrade Jenkins as well as the JVM, we recommand that you:
Upgrade Jenkins to version
2.164 or higher
How you upgrade Jenkins depends on how you installed Jenkins in the first place.
We recommend that you use the package manager of your system (such as
Validate the upgrade to confirm that all plugins and jobs are loaded
Upgrade the required plugins (see Upgrading Plugins)
Make a second backup of
JENKINS_HOME after upgrading Jenkins and the required plugins
Stop the Jenkins instance
Upgrade the JVM on which Jenkins is running
Use a package manager to install the new JVM
Make sure the default JVM is the newly installed version. If it is not, use the correct
java command in the Jenkins startup scripts (
If you are using Docker containers to run Jenkins, you should follow the same process, and change the Java version by appending
-jdk11 to the Docker image tag.
It’s important to not just upgrade Jenkins and the JVM but also to upgrade the plugins which support Java 11.
The list of plugins that are compatible with Java 11 is on the Known Java 11 Compatibility Issues Wiki page.
|If you discover a previously unreported issue, please let us know: see how to report a Java 11 Compatibility issue for guidance.|
One of the most important plugin upgrades is the Pipeline: Support plugin: make sure that the version of the plugin is at least
|Stop all Pipeline jobs before upgrading this plugin, because this upgrade changes the serialization of Pipeline builds. As a general rule,even though Pipeline jobs are supposed to survive a Jenkins restart, it’s always a better option to make sure that no Pipeline builds are in progress before any scheduled Jenkins maintenance.|
Some plugins use JAXB libraries provided by the JDK. However, the
javax.activation modules are no longer included in OpenJDK 11, and plugins might fail if no replacement is offered.
To fix this problem, we’ve bundled those libraries into a new detached plugin: JAXB plugin. When any Jenkins core more recent than
2.163 is running on Java 11, this plugin is automatically installed. However, if you manage your plugins outside Jenkins (for example, if you use
plugins.txt in your Docker images), you might need to explicitly install the plugin.
All agents must be running on the same JVM version as the controller (because of how controllers and agents communicate). If you’re upgrading your Jenkins controller to run on Java 11, you also need to upgrade the JVM on your agents.
You can validate the version of each agent with the Versions Node Monitors plugin. This plugin provides information about the JVM version of each agent on the node management screen of your Jenkins instance. This plugin can also be configured to automatically disconnect any agent with an incorrect JVM version.
Java Web Start has been removed in Java 11.
When a Jenkins controller is running on Java 11, the Java Web Start button will no longer appear in the Web UI.
Agents for a Java 11 Jenkins server can’t be launched from a
*.jnlp file downloaded to a web browser.
There are no plans to replace this functionality.
Connect agents to Jenkins on Java 11 with plugins like SSH Slaves Plugin, with operating system command line calls to
java -jar agent.jar, or by using containers.
Oracle JDK 11 licensing prevents the Jenkins community from listing the Oracle JDKs. Because of this licensing restriction, Oracle JDK 11 can’t be automatically installed by Jenkins. This problem is tracked in the issue JENKINS-54305.
As an alternative, we encourage you to use containers based on images that contain all the tooling needed for your builds.