Jenkins not starting on CentOS 7 / RHEL 7

Today i was installing Jenkins on a CentOS7 systems. After installing it via Jenkins yum repository, the service was not stating. The java was already installed on the server.

Issue

  • You have installed jenkins on a CentOS7 / RHEL7 system.
  • jenkins is not starting via systemctl start jenkins command, and it is throwing journalctl -xn error.
    Caused by: java.lang.UnsatisfiedLinkError: /tmp/jna--1712433994/jna6368781091883887102.tmp: /tmp/jna--1712433994/jna6368781091883887102.tmp: failed to map segment from shared object: Operation not permitted

Solution

  • Makes sure you have installed java and verify the version.
    # java -version
    openjdk version "1.8.0_121"
    OpenJDK Runtime Environment (build 1.8.0_121-b13)
    OpenJDK 64-Bit Server VM (build 25.121-b13, mixed mode)
  • edit /etc/sysconfig/jenkins , and change the below line,

    Line number 48, change

    ENKINS_JAVA_OPTIONS="-Djava.awt.headless=true"

    to

    JENKINS_JAVA_OPTIONS="-Djava.awt.headless=true -Djna.tmpdir=/var/lib/jenkins/tmp"
  • Now you will be able to stop and start the jenkins service without any error.
    systemctl stop jenkins
    systemctl start jenkins
0 0 votes
Article Rating
Subscribe
Notify of
guest
4 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
beto
beto
6 years ago

Thank you so much fore sharing it!
Fixed my problem.

Nelson
Nelson
6 years ago

Resolveu na raiz! muito obrigado

4
0
Would love your thoughts, please comment.x
()
x
Scroll to Top