Jenkins will not start after changing java on the host machine

  • KM03807405
  • 26-Apr-2021
  • 26-Apr-2021

Summary

After updating/changing the version of Java on the Jenkins host, Jenkins will not start

Error

Error: The Jenkins service on Local Computer started and then stopped

Cause

Jenkins still points to the previous JDK/JRE version

Fix

Procedure to fix...
1) On the jenkins box find the file "jenkins.xml". In windows this may be the path: D:\Program Files\Jenkins
2) Open the "jenkins.xml" for editing
3) Under "<service>" find the child element "<executable>"
4) Change the value to the path for the JDK/JRE installed on the Jenkins host, for example...
    <executable>C:\Program Files\Java\jdk1.8.0_291\\bin\java.exe</executable>
5) Save changes
6) Jenkins should now start