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.
One of the most common reasons why Jenkins server can't start in Windows computers is because the version of the Java language was updated after the last shutdown of Jenkins server. In order to configure Jenkins to use the correct Java version, you can follow this procedure: 1. - Edit the jenkins.
If you encounter the "Service 'Jenkins' failed to start" error too many times, the account on your computer that should run Jenkins will become locked. You will need to unlock that local account first.
You can also utilize curl and use the following commands: $ curl -X POST -u <user>:<password> http://<jenkins.server>/restart $ curl -X POST -u <user>:<password> http://<jenkins.server>/safeRestart $ curl -X POST -u <user>:<password> http://<jenkins.server>/exit $ curl -X POST -u <user>:<password> ...
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.
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:
<executable>C:\ProgramData\Oracle\Java\javapath\java.exe</executable>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With