1、修改jenkins启动的jdk版本
vim /usr/lib/systemd/system/jenkins.service #修改JENKINS_JAVA_CMD为指定的jdk路径即可 Environment="JENKINS_JAVA_CMD=/usr/local/jdk/jdk-11.0.2/bin/java"