先升级jdk11,上传解压
把以前的jdk配置注释掉,重新配置环境
export JAVA_HOME=/usr/local/environment/java/jdk11
export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$PATH:$JAVA_HOME/bin
刷新配置文件
source /etc/profile
页面打开Jenkins,然后点击自动升级,关注Jenkins日志
如果Jenkins启动报错:AWT is not properly configured on this server.
先停止Jenkins
cd /etc/init.d
# 停止
./jenkins stop
# 状态
./jenkins status
运行下面命令更新包:
yum install dejavu-sans-fonts
yum install fontconfig
yum install xorg-x11-server-Xvfb
重新启动Jenkins
使用启动命令(使用其他命令可能有未知错误,推荐使用这个)
cd /etc/init.d
# 启动
./jenkins start
如果报错Unrecognized option: --handlerCountMax=100
找到/etc/init.d/jenkins,把下面两行删除或者注释掉
[ -n "$JENKINS_HANDLER_MAX" ] && PARAMS="$PARAMS --handlerCountMax=$JENKINS_HANDLER_MAX"
[ -n "$JENKINS_HANDLER_IDLE" ] && PARAMS="$PARAMS --handlerCountMaxIdle=$JENKINS_HANDLER_IDLE"
再次重启Jenkins
1.进入Jenkins后修改全局属性JAVA_HOME为/usr/local/environment/java/jdk11
2.修改工具里的jdk