下载安装包
wget https://pkg.jenkins.io/redhat-stable/jenkins-2.150.1-1.1.noarch.rpm
安装
rpm -ivh jenkins-2.150.1-1.1.noarch.rpm
添加依赖
- 由于jdk11删除了不少包,所以根据官网指示,需要添加一些依赖的jar包:
- jaxb-api-2.3.0.jar (save as jaxb-api.jar)
- jaxb-core-2.3.0.1.jar (save as jaxb-core.jar)
- jaxb-impl-2.3.0.1.jar (save as jaxb-impl.jar)
- javax.activation v.1.2.0 (save as javax.activation.jar)
详见官网: https://jenkins.io/blog/2018/12/14/java11-preview-availability/
- 将四个包下载到 /usr/lib/jenkins 下和jenkins.war放一起比较合适
修改jenkins配置文件
- 打开配置文件
vim /etc/sysconfig/jenkins
- 找到"JENKINS_JAVA_OPTIONS",修改为如下:
JENKINS_JAVA_OPTIONS="-Djava.awt.headless=true -p /usr/lib/jenkins/jaxb-api.jar:/usr/lib/jenkins/javax.activation.jar --add-modules java.xml.bind,java.activation -cp /usr/lib/jenkins/jaxb-core.jar:/usr/lib/jenkins/jaxb-impl.jar"
- 找到"JENKINS_ARGS",修改为如下:
JENKINS_ARGS="--enable-future-java"
安装字体
sudo yum install -y fontconfig
Snipaste_2019-01-14_20-57-54.png
详见WIKI:https://wiki.jenkins.io/display/JENKINS/Jenkins+got+java.awt.headless+problem
网友评论