2

Hi Stackoverflow friends

I've recently configured Jenkins Server into Apache Tomcat 7.0.42 The procedure that I make was deploy the jenkins.war file into tomcat servlet container.

Here I make reference some important considerations:

  • My machine is a CentOS 6.4 Server:

    [root@safe2school srv]# cat /etc/redhat-release CentOS release 6.4 (Final) [root@safe2school srv]#

  • My JDK version is JDK 1.7 UPDATE 45, this is the official Oracle JDK

    [root@safe2school srv]# java -version java version "1.7.0_45" Java(TM) SE Runtime Environment (build 1.7.0_45-b18) Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode) [root@safe2school srv]#

I've tried with the installation of dejavu-sans-fonts (yum install dejavu-sans-fonts ) and set the envoronment variable export JAVA_OPTS="$JAVA_OPTS -Djava.awt.headless=true" in the file /etc/bashrc but all these options doesn't work.

The output for this error is in the following image (https://i.stack.imgur.com/DNM8m.png):

There is some alternative that you can support me in these task?

I appreciate your help. Thanks :)

bgarcial
  • 2,915
  • 10
  • 56
  • 123
  • I see that there is different alternatives for solve this problem. I install xorg-x11-xinit-session.x86_64 xorg-x11-server-Xdmx.x86_64 packages with the command yum install xorg-x11-xinit-session.x86_64 xorg-x11-server-Xdmx.x86_64 and the problem is solved. I don't – bgarcial Oct 28 '13 at 19:18
  • The best solution is definitely to use the headless property. Apparently it's not taking it for you, i.e. jenkins is starting without that options being passed. – Patrice M. Oct 28 '13 at 23:37
  • possible duplicate of [Headless continuous integration with Jenkins](http://stackoverflow.com/questions/8109607/headless-continuous-integration-with-jenkins) – Jesse Glick May 21 '14 at 17:09

2 Answers2

4

I just ran into these messages switching from OpenJDK 8 to OpenJDK 11. None of these steps helped. But make sure "fontconfig" is installed, which solved my issue!

2

Try locating the file:

 /etc/sysconfig/jenkins

and inside it, the line: JENKINS_JAVA_OPTIONS=...

Make sure it has the headless option, e.g. :

JENKINS_JAVA_OPTIONS="-Xmx2048m -XX:MaxPermSize=512m -Djava.awt.headless=true"

Otherwise, please indicate more specifically how you start your Jenkins instance.

Patrice M.
  • 4,209
  • 2
  • 27
  • 36
  • Patrice, I deploy jenkins on apache tomcat (using the file jenkins.war). According to previous comment, I start my jenkins instance with a initialization script /etc/init.d/jenkins. This script start the apache tomcat application container that host the jenkins server. – bgarcial Oct 30 '13 at 18:48
  • 1
    Can you edit the JAVA_OPTS (or rather CATALINA_OPTS) in the /etc/init.d/jenkins ? to include the java.awt.headless property. It will then be available to the deployed Jenkins app. – Patrice M. Oct 30 '13 at 21:25
  • 2
    For Ubuntu edit /etc/default/jenkins adding: `JAVA_ARGS="-Xmx2048m -XX:MaxPermSize=512m -Djava.awt.headless=true"` – Pikachu Feb 04 '14 at 21:08