MacOS 10.14.1 版本
Jenkins 2.716.2.pkg
sudo launchctl load /Library/LaunchDaemons/org.jenkins-ci.plist
# 启动 Jenkins 命令
sudo launchctl unload /Library/LaunchDaemons/org.jenkins-ci.plist
# 停止 Jenkins 命令
localhost:8080 无法访问
ps -ef | grep jenkins
没有jenkins进程,启动失败。查看vim /Library/LaunchDaemons/org.jenkins-ci.plist
配置文件得知日志路径,查看日志 cat /var/log/jenkins/jenkins.log
中发现如下错误:
Jenkins command line for execution: /usr/bin/java -Dfile.encoding=UTF-8 -XX:PermSize=256m -XX:MaxPermSize=512m -Xms256m -Xmx512m -Djava.io.tmpdir=/Users/Shared/Jenkins/tmp -jar /Applications/Jenkins/jenkins.war --httpPort=8080 Java HotSpot(TM) 64-Bit Server VM warning: Ignoring option PermSize; support was removed in 8.0 Java HotSpot(TM) 64-Bit Server VM warning: Ignoring option MaxPermSize; support was removed in 8.0 7月 28, 2019 7:27:59 下午 Main verifyJavaVersion 严重: Running with Java class version 56 which is not in the list of supported versions: [52, 55]. Run with the --enable-future-java flag to enable such behavior. See https://jenkins.io/redirect/java-support/ java.lang.UnsupportedClassVersionError: 56.0 at Main.verifyJavaVersion(Main.java:174) at Main.main(Main.java:142) Jenkins requires Java versions [8, 11] but you are running with Java 12 from /Library/Java/JavaVirtualMachines/jdk-12.0.1.jdk/Contents/Home java.lang.UnsupportedClassVersionError: 56.0 at Main.verifyJavaVersion(Main.java:174) at Main.main(Main.java:142)
sudo /usr/bin/java -Dfile.encoding=UTF-8 -XX:PermSize=256m -XX:MaxPermSize=512m -Xms256m -Xmx512m -Djava.io.tmpdir=/Users/Shared/Jenkins/tmp -jar /Applications/Jenkins/jenkins.war --httpPort=8080 --enable-future-java
再次启动,访问 localhost:8080,访问成功~
PS:每次重新启动都需要执行以上命令
网友评论