There are separate run and job execution requirements for Jenkins installations.
Jenkins requires Java 11 or 17 since Jenkins 2.357 and LTS 2.361.1. Read more about this in the announcement blog post.
Upgrading Java version to 11
Upgrading an existing Jenkins setup from Java 8 to Java 11? Refer to the upgrade guidelines.
Java 11 Docker installation instructions are included in "Downloading and running Jenkins in Docker".
jenkins/jenkins:jdk17 Docker image allows you to run the Jenkins controller on Java 17.
All other Java versions are not supported.
These requirements apply to all components of the Jenkins system, including the Jenkins controller, all types of agents, CLI clients, and other components.
The Jenkins project performs a full test flow with the following JDK/JREs:
OpenJDK JDK / JRE 11 - 64 bits
OpenJDK JDK / JRE 17 - 64 bits
JRE/JDKs from other vendors are supported and may be used. Refer to our issue tracker for known Java compatibility issues.
The version of the JDK used to build Java-based projects, or the version of Java used to run Java-based tools is independent from the version of Java used to run the Jenkins controller and agent processes. During a build, any version of the JRE or JDK can be launched as long as it’s compatible with the system the build is running on. This includes:
javac from shell build steps and similar
Execution of Maven/Ant/… build steps using a JDK managed by JDK tool installers
A few plugins have more strict requirements, generally requiring that a build is executing in the same version of Java as is used to run the Jenkins controller and agents. A notable example of that is Maven Integration Plugin, which requires that the version of the JDK used for the Maven build must be at least the same version as is used for the Jenkins controller. These cases are generally documented in the plugin documentation.
Modern versions of Jenkins controllers and Jenkins agents verify Java requirements and notify users when they are launched with an unsupported version.
The Versions Node Monitors plugin provides detailed Java version monitoring.