Child pages
  • Installing Jenkins on Red Hat distributions

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Jenkins requires Java in order to run, yet certain distros don't include this by default. To install the Open Java Development Kit (OpenJDK) run the following:

Code Block

sudo yum install java

Note: If running CentOS, ensure you follow the guide below.

...

Note: if you get the following error message, ensure that Java has been installed:

Code Block

Starting jenkins (via systemctl):  Job for jenkins.service failed. See 'systemctl status jenkins.service' and 'journalctl -xn' for details.
                                                           [FAILED]

...

Disable the firewall

Code Block

firewall-cmd --zone=public --add-port=8080/tcp --permanent
firewall-cmd --zone=public --add-service=http --permanent
firewall-cmd --reload
Code Block

firewall-cmd --list-all

Important Note on CentOS Java

...

If you get output similar to the following, it means you're using the default (GCJ) version of Java, which will not work with Jenkins:

Code Block

java -version
java version "1.57.0"
gij (GNU libgcj) version 4.4.6 20110731 (Red Hat 4.4.6-3)

...

If you received the above output, uninstall the default java:

Code Block
  yum remove java

Then after you've uninstalled Java (or if you didn't have Java installed at all to begin with). You need to install a Sun-compatible version of Java. The easiest approach is using OpenJDK, which is available through the EPEL repository (alternatively you may install an official RPM directly from Oracle). To install OpenJDK run the following:

Code Block
  yum install java-1.78.0-openjdk

Depending on your version of CentOS, the package name for OpenJDK may differ. Use yum search openjdk to check for the name of the package. If OpenJDK is not found at all through yum, you probably need to install the EPEL yum repository. After installation, you should be able to get the following output for java -version:

Code Block

java -version
javaopenjdk version "1.78.0_79161"
OpenJDK Runtime Environment (rhel-2.5.5.1.el6_6-x86_64 u79-build 1.8.0_161-b14)
OpenJDK 64-Bit Server VM (build 2425.79161-b02b14, mixed mode)