There are a few details and steps to upgrade the JVM used to run Jenkins, more specifically from Java 11 to Java 17.
If you’re upgrading the JVM used to run Jenkins, particularly from Java 11 to Java 17, 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.
If you need to upgrade Jenkins as well as the JVM, we recommend that you:
Update all of your installed plugins.
Back up JENKINS_HOME
.
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, run systemctl edit jenkins
and set either the JAVA_HOME
environment variable or the JENKINS_JAVA_CMD
environment variable.
Upgrade Jenkins to the most recent version
How you upgrade Jenkins is dependent upon your original Jenkins installation method.
We recommend using the package manager of your system, such as apt
or yum
.
Validate the upgrade to confirm that all plugins and jobs are loaded.
Upgrade the required plugins. Refer to Upgrading Plugins for more information.
It’s important not just to upgrade Jenkins and the JVM, but also to upgrade the plugins which support Java 17. Plugin upgrades assure compatibility with the most recent Jenkins releases.
If you discover a previously unreported issue, please let us know. Refer to our issue reporting documentation for guidance. |
All agents must be running on the same JVM version as the controller, due to how controllers and agents communicate. If you’re upgrading your Jenkins controller to run on Java 17, you also need to upgrade the JVM on your agents.
Validating the version of each agent can be done 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.