linux下用tomcat启用jenkinswar包一直报Can't connect to X11 window server using 'localhost:10.0' as the value

1、Can't connect to X11 window server using 'localhost:10.0' as the value of the DISPLAY variable

打开tomcat/bin下的catalina.sh,打开文件catalina.sh

在所有的        -Dcatalina.home="$CATALINA_HOME" /下面都加上了-Djava.awt.headless=true

如下图:    linux下用tomcat启用jenkinswar包一直报Can't connect to X11 window server using 'localhost:10.0' as the value

这样就不会报错了。打开如图:

linux下用tomcat启用jenkinswar包一直报Can't connect to X11 window server using 'localhost:10.0' as the value

2、还有一个问题,错误提示是The selected http port (8080) seems to be in use by another program

/etc/default/jenkins.修改Jenkins默认端口设置8080,需要进入文件修改jenkins默认端口号:

修改默认端口为 HTTP_PORT=8090即可