Cannot start Jenkins service in Windows after updates

I also had this problem after each java update. But there is a version-independent absolute path, that can be used to start the java run-time: C:\ProgramData\Oracle\Java\javapath\java.exe.

I changed jenkins-slave.xml to use this path:


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.