Migrate to Java 17

6 minute read

Java 17 was released on September 14, 2021, as a long-term support (LTS) version. The Jenkins community supports running Jenkins with Java 17 since 2.361.1 and CloudBees CI supports running in Java 17 since version 2.440.1.3. When the Jenkins community moves to support Java 17-specific features (Java 17 byte code), you will not be able to use a Java 11 runtime environment. Because CloudBees CI is based on the Jenkins LTS, future releases of CloudBees CI will have the same requirement.

For more information about the JVM support model, refer to Migrating to Java 17.

CloudBees has validated the core functionality and all plugins in the CloudBees Assurance Program work correctly when using Java 17. Plugins that are not part of the CloudBees Assurance Program may work, but they have not been verified and may cause issues especially in mixed JVM scenarios.

If you use Helm charts to manage CloudBees CI on modern cloud platforms deployments, both Operations center and controllers are automatically upgraded to Java 17, the same happens for agent images. If you are not using the CloudBees CI agent image, you need to manually update your agent image to include and use Java 17 as the default Java installation. Similarly, shared agents and cloud agents must be manually updated to use Java 17.

Supported configurations

CloudBees performs full test flows with the following supported JDKs or JREs:

  • OpenJDK JDK/JRE 11 - 64 bits

  • OpenJDK JDK/JRE 17 - 64 bits

CloudBees CI version 2.440.1.3 and onward

Table 1. CloudBees CI 2.440.1.3 and onward
Component Supported Java version

Operations center

Java 17 and Java 11

Controller and agents

Java 17 (if and only if Operations center is also running Java 17) and Java 11

Operations center shared agents

Java 17 (if and only if Operations center is also running Java 17) and Java 11

Action required

CloudBees supports mixed-mode JVM usage beginning in the February 2024 release (version 2.440.1.3) and will continue to support it until a late 2024 release. This lets you transition into a supported version of Java without impacting the CloudBees CI operations. CloudBees supports the operations center running Java 17, with controllers running only Java 17 or Java 11. An operations center that runs Java 11 with controllers that run Java 17 is not supported. All agents must run a Java version at least as new as the currently minimum version required by controllers. We recommend that you update them to Java 17 as soon as possible, as any agent that uses a Java version below 17 will stop working in late 2024.

CloudBees CI on modern cloud platforms uses default Docker images that come preinstalled with the correct Java version. If you use custom build agents, all agents must be running a Java version at least as new as the currently minimum version required by controllers. We recommend that you update those podTemplates to Java 17 as soon as possible as any agent using a Java version below 17 will stop working in late 2024. This does not impact the ability to use a different JDK version as a build tool.

Upgrade the JVM used to run CloudBees CI

You must keep the following things in mind when you upgrade the JVM used to run CloudBees CI.

Operations center instances must be updated to use Java 17 before you can update controllers and their agents. Failure to do so may result in the loss of connectivity between the operations center and controllers using Java 17.

As with any upgrade, CloudBees recommends that you back up JENKINS_HOME and test the upgrade with a backup before you perform the upgrade on your production instance.

CloudBees CI on modern cloud platforms customers should follow the standard upgrade process.

Beginning in CloudBees CI version 2.440.1.3, the CloudBees CI on modern cloud platforms Docker images include Java 17.

If you use custom build agents, you should update those podTemplates to ensure they are using Java 17 as soon as possible.

Upgrade the plugins

In addition to upgrading CloudBees CI and the JVM, you must upgrade any plugins to support Java 17. Plugin upgrades ensure compatibility with the most recent CloudBees CI releases. CloudBees has verified that all plugins in the CloudBees Assurance Program run without issue when using Java 17.

If you discover a previously unreported issue, contact CloudBees Support. If the issue involves a Jenkins community plugin, CloudBees will report it and can suggest workarounds to avoid a broken plugin.

Monitor the Java versions automatically

CloudBees CI on modern cloud platforms controllers and build agents verify Java requirements and notify users when they are launched using an unsupported version. The Versions Node Monitors plugin also provides detailed Java version monitoring.

Known issues

Refer to the following sections for any known issues that may affect your migration to Java 17.

CloudBees DevOptics Installation plugin

The old versions of DevOptics will prevent your operations center or controller from starting if you try to run Java 17. You must remove the CloudBees DevOptics Installation plugin, if it is installed, before you upgrade to CloudBees CI 2.440.1.3.

JVM version on agents

All agents must run a Java version at least as new as the currently minimum version required by controllers. We recommend that you update them to Java 17 as soon as possible, as any agent using a Java version below 17 will stop working in late 2024.

You can validate each agent’s version using the Version Node Monitors plugin. This plugin provides information about the JVM version of each agent on the node management screen of your CloudBees CI instance. You can also configure this plugin to automatically disconnect any agent with an incorrect JVM version.

JVM version on operations center shared agents

JVM instances are used to establish the remoting connection between shared agents and controllers, as well as shared agents and the operations center. Additional JVMs could be installed on the agent computer and used as build tools by controller jobs. Those JVMs are irrelevant in this context, and there is no need to update them as part of the CloudBees CI Java 17 migration.

Depending on the launch method and agent configuration, you may have to take additional actions when you upgrade to Java 17.

"Launch agent by connecting it to the controller" launch method

This launch method is also known as an "inbound" agent. It is the agent that initiates the connection to the controller. This configuration also requires the agent computer to initiate the connection to the operations center. This launch method requires two JVM instances. One maintains the connection to the operations center and it is called the shared agent control JVM. The other connects to the controller when the agent is leased and it is called the agent JVM. These two JVM instances do not need to run the same JVM version.

We recommend that when you upgrade the operations center JVM to Java 17, the shared agent control JVM is also upgraded to run Java 17. If the shared agent is going to be leased to a controller, we recommend you upgrade the JVM to Java 17 before the controller runs Java 17. If that is not possible, using Java 11 on the agent and Java 17 on the controller is supported, but we recommend you upgrade your agent to Java 17 as soon as possible. All agents must migrate to Java 17 in late 2024.

"Launch build agents via SSH" launch method

This launch method is also known as an "outbound" agent. It means the controller is initiating the connection to the agent computer via SSH and then automatically starting the agent JVM.

There is no shared agent control JVM involved in this configuration. There is only one JVM, the agent JVM. We recommend you upgrade the JVM to Java 17 before the controller runs Java 17. If that is not possible, using Java 11 on the agent and Java 17 on the controller is supported, but we recommend you upgrade your agent to Java 17 as soon as possible. All agents must migrate to Java 17 before late 2024. The path to this JVM binary is configurable in the shared agent configurations.

Execute the jobs on CloudBees CI

CloudBees CI jobs can be executed on Java versions that differ from the controller/agent runtime’s Java version. Generally, CloudBees CI allows any version of JRE/JDK to be invoked during the build. That includes executing Java commands from the CLI, as well as installing and executing build steps using a JDK managed by JDK tool installers.

There are still Java requirements for particular plugins:

Custom JVM arguments

Some JVM arguments have changed or are no longer supported by Java 17. If you customized the JVM arguments used to start your CloudBees CI operations center, controllers, or agents, you may need to modify them. For more information about the recommended JVM arguments, refer to Adding Java arguments to the Jenkins service configuration file.