While installing Jenkins on VM getting below error

.
[bob@centos-host ~]$ systemctl status jenkins.service
● jenkins.service - Jenkins Continuous Integration Server
Loaded: loaded (/usr/lib/systemd/system/jenkins.service; disabled; vendor preset: disabled)
Active: failed (Result: start-limit) since Sun 2022-03-13 11:53:07 UTC; 2min 49s ago
Process: 2234 ExecStart=/usr/bin/jenkins (code=exited, status=1/FAILURE)
Main PID: 2234 (code=exited, status=1/FAILURE)
[bob@centos-host ~]$ sudo systemctl start jenkins
Job for jenkins.service failed because the control process exited with error code. See “systemctl status jenkins.service” and “journalctl -xe” for details

Any one faced same issue ? how to resolve it ?

@Dheeraj1232
Thanks for reporting, we will check it ASAP.

Hello, @Dheeraj1232
As an update, One of our team members is working on it.
If you are interested to troubleshoot and fix that issues then please check the below thread -

2 Likes

Yes I faced the same Error . checked the Network Service In Centos is down . Could not get it up because of not knowing the internal network Config .

IT HAS Worked !!! , Many Many Thanks for this help . So Very Nice of you @kishlay-raj .

Please post the commands you used , i am a new bee to jenkins

Hello @kumarmishra651
Commands are available in the Hint/Solution section.

Regards,
KodeKloud Support

1 Like

java version issue by default java comming with 1.8 but you need jdk11

sudo journalctl -xe -u jenkins

root@devsecops ~]# sudo journalctl -xe -u jenkins

– The result is failed.
Sep 23 19:12:35 devsecops jenkins[38205]: Sep 23, 2022 7:12:35 PM executable.Main verifyJavaVersion
Sep 23 19:12:35 devsecops jenkins[38205]: SEVERE: Running with Java class version 52, which is old>
Sep 23 19:12:35 devsecops jenkins[38205]: java.lang.UnsupportedClassVersionError: 52.0
Sep 23 19:12:35 devsecops jenkins[38205]: at executable.Main.verifyJavaVersion(Main.java:1>
Sep 23 19:12:35 devsecops jenkins[38205]: at executable.Main.main(Main.java:109)
Sep 23 19:12:35 devsecops jenkins[38205]: Jenkins requires Java versions [17, 11] but you are runn>
Sep 23 19:12:35 devsecops jenkins[38205]: java.lang.UnsupportedClassVersionError: 52.0
Sep 23 19:12:35 devsecops jenkins[38205]: at executable.Main.verifyJavaVersion(Main.java:1>
Sep 23 19:12:35 devsecops jenkins[38205]: at executable.Main.main(Main.java:109)
Sep 23 19:12:35 devsecops systemd[1]: Failed to start Jenkins Continuous Integration Server.
– Subject: Unit jenkins.service has failed
– Defined-By: systemd
– Support: Red Hat Customer Experience & Engagement - Red Hat Customer Portal

– Unit jenkins.service has failed.

– The result is failed.
Sep 23 19:12:35 devsecops systemd[1]: Failed to start Jenkins Continuous Integration Server.
– Subject: Unit jenkins.service has failed
– Defined-By: systemd
– Support: Red Hat Customer Experience & Engagement - Red Hat Customer Portal

– Unit jenkins.service has failed.

– The result is failed.

Hi @adepuajay,
Thanks for sharing the tips.

If you are having this issue, just install java 11 instead of 1.8

sudo yum install java-11-openjdk-devel

2 Likes

What worked for me ( Install Jenkins on CentOS 8)
Remember: login using root
steps:

  1. yum -y install java-11-openjdk-devel
  2. java -version
  3. sudo vi /etc/profile.d/java.sh
    export JAVA_HOME=$(dirname $(dirname $(readlink $(readlink $(which javac)))))
    export PATH=$PATH:$JAVA_HOME/bin
    export JRE_HOME=/usr/lib/jvm/jre
    export CLASSPATH=.:$JAVA_HOME/jre/lib:$JAVA_HOME/lib:$JAVA_HOME/lib/tools.jar
  4. source /etc/profile.d/java.sh
  5. wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat-stable/jenkins.repo
  6. rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key
  7. yum update
  8. yum install jenkins -y
  9. systemctl daemon-reload
  10. systemctl start jenkins
  11. systemctl status jenkins
1 Like

facing the same issue at the moment

After lots of research and looking through answers from KodeKloud community. I found solution which worked for me.

sudo yum -y install java-11-openjdk-devel
java -version
sudo wget -O /etc/yum.repos.d/jenkins.repo \
    https://pkg.jenkins.io/redhat-stable/jenkins.repo
sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io-2023.key

sudo yum update
sudo yum install jenkins -y
#Edit PORT no setting here
sudo systemctl edit --full jenkins
sudo systemctl enable jenkins
sudo systemctl start jenkins

I would like to thank @Tej-Singh-Rana @Sunil-Ror @mmkmou @Dickson-Victor and Google.