Cannot start Jenkins service in Windows after updates

koxta picture koxta · Jan 28, 2018 · Viewed 12.3k times · Source

I have Jenkins running on Windows as a service. Normally, it starts when machine starts.

After a Windows recommended update this afternoon, and a machine restart, my Jenkins just stopped working.

I start the service but it stops and shows the following warning:

"The Jenkins service on Local Computer started and then stopped. Some 
services stop automatically if they are not in use by other services or 
programs."

There is no "jenkins.err.log" file and if I start Jenkins with "java jenkins.war" It works fine.

Any tip whats going on? How to fix this? Please help.

Thank you very much.

Answer

user1777224 picture user1777224 · Feb 15, 2018

I had the same problem. It appeared that the java runtime enviromment had been updated. In the jenkins installation folder there is as jenkins.wrapper.log. This contains logging from the jenkins.exe service wrapper. In my case it tried to start java from c:\Program Files\Java\jre1.8.0_144\bin. This folder did not exist, instead, java was installed in c:\Program Files\Java\jre1.8.0_161\bin.

In the jenkins installation folder there is also a jenkins.xml. This contains the reference to the java installation in the tag. Change it to your current java installation and it will start again.