一、环境
Ubuntu 18.04.1 LTS
Oracle JDK 1.8.0_201
Jenkins 2.150.3
二、报错
在服务器环境下由于缺少部分图形界面相关的依赖Jenkins会报错:
1 2 3 4 |
AWT is not properly configured on this server. Perhaps you need to run your container with "-Djava.awt.headless=true"? See also: https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+got+java.awt.headless+problem java.lang.UnsatisfiedLinkError: /usr/lib/java/jre/lib/amd64/libawt_xawt.so: libXrender.so.1: cannot open shared object file: No such file or directory |
并给出了一个参考链接:
由于缺少AWT相关文件导致Jenkins报错然而,在该参考链接(https://wiki.jenkins.io/display/JENKINS/Jenkins+got+java.awt.headless+problem)中,给出的解决方案都是针对OpenJDK和SunJDK的,对于Ubuntu 18.04.1 LTS和Oracle JDK 1.8.0_201而言,需要安装如下两个库,然后重启Web容器即可:
1 2 |
apt-get install libxrender-dev apt-get install libxtst-dev |
参考资料:
1、https://wiki.jenkins.io/display/JENKINS/Jenkins+got+java.awt.headless+problem
2、http://blog.sina.com.cn/s/blog_8ea8e9d50102xfrf.html
转载时请保留出处,违法转载追究到底:进城务工人员小梅 » 解决Ubuntu 18.04下使用Oracle JDK时Jenkins找不到libawt_xawt.so、libXrender.so、libXtst.so的问题