1先在互联网上输入jenkins.io
2下载jenkins.war
3上传到服务器上
安装jdk前面的博客已经说过了
4 Jenkins requires Java versions [8, 11] but you are running with Java 1.7 from /usr/java/jdk1.7.0_06/jre
java.lang.UnsupportedClassVersionError: 51.0
at Main.verifyJavaVersion(Main.java:182)
at Main.main(Main.java:142)
报错,版本太低
5AWT is not properly configured on this server. Perhaps you need to run your container with “-Djava.awt.headless=true”? See also: https://jenkins.io/redirect/troubleshooting/java.awt.headless
报错,据说视版本问题
进入网址没能正确解决
5sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo
sudo rpm --import https://jenkins-ci.org/redhat/jenkins-ci.org.key
sudo yum install jenkins
安装
启动报错
Restarting jenkins (via systemctl): Job for jenkins.service failed because the control process exited with error code. See “systemctl status jenkins.service” and “journalctl -xe” for details
修改etc/init.d/jenkins文件加入
Candidates文件下加入
/usr/java/java-se-8u40-ri/bin/java
解决
AWT is not properly configured on this server. Perhaps you need to run your container with “-Djava.awt.headless=true”? See also: https://jenkins.io/redirect/troubleshooting/java.awt.headless
还是报错
6继续测试
wget http://pkg.jenkins-ci.org/redhat-stable/jenkins-2.7.3-1.1.noarch.rpm
rpm -ivh jenkins-2.7.3-1.1.noarch.rpm
sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo
sudo rpm --import https://jenkins-ci.org/redhat/jenkins-ci.org.key
sudo yum install Jenkins
service jenkins restart启动,换了台服务器成功。