Jenkins version 2.462.3 windows service is not starting with openjdk 17 or openjdk 21

We are using 2.426.2 with openjdk 11 on windows machine and it worked perfectly fine.

We thought to upgrade to latest version to 2.462.3 by updating war file with openjdk 17 or openjdk 21

As per the document, Jdk also I should update. Because Java 11 support was stopped.

Problem I faced and scenario I tested.

openjdk 17 with newer version 2.462.3 - Didnt worked, windows service is not started
openjdk 21 with newer version 2.462.3 - didnt worked, windows service is not started
openjdk 11 with newer version 2.462.3 - service is started and worked.

What I observed is we are not able to move from openjdk 11 to openjdk higher version if use the latest version of jenkins.

When we start the jenkins service on windows machine. We end up this error.

Can you look at the logs for Jenkins? I believe the service wrapper log is in C:\Program Files\Jenkins by default. It may give you some information as to what is going wrong. How did you upgrade Jenkins to use JDK 17?

1 Like

@slide_o_mix Thanks for sharing to check the logs.

It was actually a Java update. In the recent Java version

Starting OpenJDK17 these java options -XX:MaxPermSize=256m have been removed and using them results in an error. We need to remove -XX:MaxPermSize=512m in java option and replace with -XX:MaxMetaspaceSize=512m. in the Jenkins.xml config file.

See: Removed Java Options Documentation

Server is up and running now.

1 Like

Thanks a lot for the feedback, @prem413.

1 Like

Can you share how to make the above change?
I made the changes and still Jenkins v 2.462.3 is not coming up with Java21

@dsinha

please make a change in Jenkins.xml file under JENKINS_HOME directory.
If I am not wrong. Line between 40 to 43

image