最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

ubuntu - Jenkins does not start anymore after plugin update - Stack Overflow

programmeradmin1浏览0评论

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
  • Btw. buildmaster@jenkins:~$ java --version java 17.0.12 2024-07-16 LTS Java(TM) SE Runtime Environment (build 17.0.12+8-LTS-286) Java HotSpot(TM) 64-Bit Server VM (build 17.0.12+8-LTS-286, mixed mode, sharing) – user2452157 Commented Nov 19, 2024 at 13:25
  • Isn't /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
Add a comment  | 

2 Answers 2

Reset to default 0

i 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

发布评论

评论列表(0)

  1. 暂无评论