Installation of Jenkins on centos

Instead of using docker jenkins image i want to install jenkins on a linux centos VM. I had installed the jenkins package and i was not able to start. I am getting the below error. Can any one help pls

Linux version - centos 7.4

############################# Java package on the server #############

java-1.8.0-openjdk-headless-1.8.0.131-11.b12.el7.x86_64

python-javapackages-3.4.1-11.el7.noarch

tzdata-java-2017b-1.el7.noarch

javapackages-tools-3.4.1-11.el7.noarch

java-1.8.0-openjdk-1.8.0.131-11.b12.el7.x86_64

#######################

[root@jenkins mnt]# 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.

[root@jenkins mnt]#

#####################

[root@jenkins init.d]# jenkins start

jenkins: invalid Java version: openjdk version "1.8.0_131"

OpenJDK Runtime Environment (build 1.8.0_131-b12)

OpenJDK 64-Bit Server VM (build 25.131-b12, mixed mode)

[root@jenkins init.d]#

####################

[root@jenkins etc]# cd /usr/lib/jvm

[root@jenkins jvm]# ll

total 0

drwxr-xr-x. 3 root root 17 Oct 18 13:30 java-1.8.0-openjdk-1.8.0.131-11.b12.el7.x86_64

lrwxrwxrwx. 1 root root 21 Oct 18 13:30 jre -> /etc/alternatives/jre

lrwxrwxrwx. 1 root root 27 Oct 18 13:30 jre-1.8.0 -> /etc/alternatives/jre_1.8.0

lrwxrwxrwx. 1 root root 35 Oct 18 13:30 jre-1.8.0-openjdk -> /etc/alternatives/jre_1.8.0_openjdk

lrwxrwxrwx. 1 root root 50 Oct 18 13:30 jre-1.8.0-openjdk-1.8.0.131-11.b12.el7.x86_64 -> java-1.8.0-openjdk-1.8.0.131-11.b12.el7.x86_64/jre

lrwxrwxrwx. 1 root root 29 Oct 18 13:30 jre-openjdk -> /etc/alternatives/jre_openjdk

[root@jenkins jvm]#

######################

[root@jenkins jvm]# journalctl -xe -u jenkins

Oct 18 15:15:14 jenkins.localdomain systemd[1]: Failed to start Jenkins Continuous Inte

-- Subject: Unit jenkins.service has failed

-- Defined-By: systemd

-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

--

-- Unit jenkins.service has failed.

--

-- The result is failed.

Oct 18 15:15:14 jenkins.localdomain systemd[1]: Unit jenkins.service entered failed sta

Oct 18 15:15:14 jenkins.localdomain systemd[1]: jenkins.service failed.

Oct 18 15:15:14 jenkins.localdomain systemd[1]: jenkins.service holdoff time over, sche

Oct 18 15:15:14 jenkins.localdomain systemd[1]: start request repeated too quickly for

Oct 18 15:15:14 jenkins.localdomain systemd[1]: Failed to start Jenkins Continuous Inte

-- Subject: Unit jenkins.service has failed

-- Defined-By: systemd

-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

--

-- Unit jenkins.service has failed.

--

-- The result is failed.

Oct 18 15:15:14 jenkins.localdomain systemd[1]: Unit jenkins.service entered failed sta

Oct 18 15:15:14 jenkins.localdomain systemd[1]: jenkins.service failed.

[root@jenkins jvm]#

#######################################

I went to /etc/sysconfig/jenkins and changed the user from jenkins to root. no luck and also tried to add path in /etc/init.d/jenkins and no luck either.

i tried to change the port and tried to reload the jenkins and same error.

Any help is highly appreciated.

Hi there,

Jenkins 2.332.1 switched Jenkins from using System V init to use systemd with its Linux package installers for Debian, Ubuntu, Red Hat, Alma, openSUSE, Rocky, and more. The LTS Upgrade Guide describes that transition and how to adapt your environment to the transition.

There is a blog post about it as well at

There is also a video introduction for RPM based distributions like Red Hat Enterprise Linux, Alma Linux, Rocky Linux, Oracle Linux, and Amazon Linux.

There is also a video introduction for deb based distributions like Debian and Ubuntu

1 Like