Back to blog

Java 17 Preview is available in Jenkins 2.339+

Basil Crow
March 21, 2022

Please refer to the Java requirements documentation for up-to-date details on how to run Jenkins on Java 17.

Jenkins Java

Jenkins, one of the leading open-source automation servers, does not yet officially support Java 17. On September 14, 2021, OpenJDK 17 was released. This is a Long-Term-Support (LTS) release, and it will stay around for years. The Jenkins project is eager to offer full support of this version. Over the last year, many contributors have been working toward enabling support for Java 17 in the project. It was a thorny path, but now, on behalf of the Jenkins Platform SIG, we are happy to announce preview availability of Java 17 support in Jenkins weekly releases!

Why do we need preview availability for Java 17? It offers Jenkins contributors and early adopters a way to try out the changes before the general availability release happens later this year. It should help us to get more exploratory testing and, hopefully, resolve most of the issues before Java 17 is officially supported in Jenkins.

In this blog post we will describe how to run with Java 17 and how to investigate and report compatibility issues.

Background

A group of contributors has been working on Java 17 support, focusing on enabling Java 17 support in development tools, testing, and addressing known compatibility issues. See the Platform SIG meeting notes for detailed status updates. Starting with Jenkins 2.339, Jenkins successfully runs with latest OpenJDK 17 releases on various Linux and Windows platforms. We performed a lot of automated and exploratory tests. Jenkins plugins appear to work well. There is ongoing test automation effort toward the GA release, but we were able to successfully run Jenkins core tests and Plugin Compatibility Tester for recommended plugins.

Running Jenkins and Java 17 in Docker

For several months, we have provided Docker images for the Jenkins controller and agent. All these images are based on the official Debian stable and Eclipse Temurin images maintained by the Docker community.

Jenkins controller image

Java 17 support is now provided as a part of the official jenkins/jenkins image. You can run Jenkins with Java 17 simply as:

docker run -p 8080:8080 -p 50000:50000 jenkins/jenkins:jdk17-preview

The following tags are available:

jdk17-preview

Latest weekly release with Java 17 support

2.339-jdk17-preview

Weekly releases packaged with Java 17

The image is fully compatible with the official Jenkins Docker image documentation, e.g., you can use plugins.txt to install plugins, mount volumes, and pass extra options via environment variables.

Agent images

If you use containerized agents via the Docker or Kubernetes plugins, we have also released official Docker images for Jenkins agents:

All images use the jdk17-preview tag.

Running Jenkins with Java

As with Java 11, you can start Jenkins using the java command:

java -jar jenkins.war --enable-future-java

Compatibility issues

In March 2022, the community performed many exploratory tests to discover as many Java 17 issues as possible.

As a result, the community solved a lot of problems before announcing Java 17 support in Jenkins. However, it is still possible that some plugins have not been updated to support Java 17.

If you find a regression in a plugin, please file a bug report in Jira:

For security issues, please use the standard vulnerability reporting process. Although we will be fixing Java 17 specific issues in public while Java 17 support is in preview, following the security process will help us to investigate the impact on Java 8 and 11 users.

Contributing

We appreciate any and all contributions in the Java 17 effort, including trying out Jenkins with Java 17 and reporting or fixing compatibility issues.

  • If you want to do exploratory testing, we recommend trying out Java 17 support on one of your test controllers. Such testing is highly appreciated, especially if you use some service integration plugins or exotic platforms.

  • If you are a plugin developer/maintainer, we would appreciate if you could test your plugin with Java 17. Java 17 developer guidelines are forthcoming.

Whatever you do, please let us know about your experience by sending a message to the Platform SIG mailing list. This information will help us track changes and contributions. Any other feedback about the migration will be appreciated!

What’s next?

We will soon be updating the toolchain to support Java 17. At that point, we will publish documentation for plugin developers explaining how to test plugins with Java 17.

In the coming weeks we will focus on addressing feedback from early adopters and fixing any discovered compatibility issues. We will also continue working on Java 17 support patches toward general availability later this year.

About the author

Basil Crow

Basil is a long-time Jenkins user and contributor, a Jenkins core maintainer, and the maintainer of the Email Extension, Timestamper, and Swarm plugins (among others). Basil enjoys working on open source software in his free time.