I have 2.479.1 LTS installed on a Ubuntu 22.04.5 LTS (GNU/Linux 5.15.0-126-generic x86_64). After a plugin upgrade, jenkins refuses to start. When I try manually:
buildmaster@jenkins$~: sudo systemctl start jenkins.service
[sudo] password for buildmaster:
Job for jenkins.service failed because the control process exited with error code.
See "systemctl status jenkins.service" and "journalctl -xeu jenkins.service" for details.
journalctl -xeu jenkins.service
reveals:
Nov 19 14:10:44 jenkins jenkins[9661]: Error: Could not find or load main class self
Nov 19 14:10:44 jenkins jenkins[9661]: Caused by: java.lang.ClassNotFoundException: self
Nov 19 14:10:44 jenkins systemd[1]: jenkins.service: Main process exited, code=exited, status=1/FAILURE
I have no clue, what can I do?
When I simply start jenkins with /usr/bin/jenkins
then it uses wrong jenkins home, even if I set variable JENKINS_HOME=/var/lib/jenkins before. But its the wrong user anyway.
How can I get it to run again?
I have 2.479.1 LTS installed on a Ubuntu 22.04.5 LTS (GNU/Linux 5.15.0-126-generic x86_64). After a plugin upgrade, jenkins refuses to start. When I try manually:
buildmaster@jenkins$~: sudo systemctl start jenkins.service
[sudo] password for buildmaster:
Job for jenkins.service failed because the control process exited with error code.
See "systemctl status jenkins.service" and "journalctl -xeu jenkins.service" for details.
journalctl -xeu jenkins.service
reveals:
Nov 19 14:10:44 jenkins jenkins[9661]: Error: Could not find or load main class self
Nov 19 14:10:44 jenkins jenkins[9661]: Caused by: java.lang.ClassNotFoundException: self
Nov 19 14:10:44 jenkins systemd[1]: jenkins.service: Main process exited, code=exited, status=1/FAILURE
I have no clue, what can I do?
When I simply start jenkins with /usr/bin/jenkins
then it uses wrong jenkins home, even if I set variable JENKINS_HOME=/var/lib/jenkins before. But its the wrong user anyway.
How can I get it to run again?
Share Improve this question asked Nov 19, 2024 at 13:24 user2452157user2452157 3711 gold badge3 silver badges14 bronze badges 2 |2 Answers
Reset to default 0i just update the jdk version to 17
sudo apt update sudo apt install openjdk-17-jdk -y
And verify that 11 jdk verison is installed
java -version
And if you have multiple Java versions, set Java 17 as the default using:
sudo update-alternatives --config java
And restarted jenkins
sudo systemctl restart jenkins
my issue got solved
it worked here after I updated my java jdk 11 to java jdk 17
/usr/bin/jenkins
a wrapper shell script, which is setting the ENV JENKINS_HOME overwriting the env var? Try to edit/usr/bin/jenkins
and edit the var there. – Michael D. Commented Nov 19, 2024 at 15:47