我刚刚下载了Jenkins WAR版本1.657.1.我试图在我的Amazon Linux机器上进行设置.我正在运行Java 1.7.我将WAR移到其自己的目录/usr/share / java / jenkins中,然后将JENKINS_HOME设置为该目录.然后,我运行了此处列出的命令-https://wiki.jenkins-ci.org/display/JENKINS/Starting+and+Accessing+Jenkins.在网站上看起来很简单.但是你不知道吗得到了以下错误
[davea@mydevbox ~]$java -jar /usr/share/java/jenkins/jenkins.war
Running from: /usr/share/java/jenkins/jenkins.war
webroot: EnvVars.masterEnvVars.get("JENKINS_HOME")
Apr 19, 2016 9:29:34 PM winstone.Logger logInternal
INFO: Beginning extraction from war file
Apr 19, 2016 9:29:34 PM winstone.Logger logInternal
INFO: Winstone shutdown successfully
Apr 19, 2016 9:29:34 PM winstone.Logger logInternal
SEVERE: Container startup failed
java.io.FileNotFoundException: /usr/share/java/jenkins/war/META-INF/MANIFEST.MF (No such file or directory)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:221)
at java.io.FileOutputStream.<init>(FileOutputStream.java:171)
at winstone.HostConfiguration.getWebRoot(HostConfiguration.java:280)
at winstone.HostConfiguration.<init>(HostConfiguration.java:83)
at winstone.HostGroup.initHost(HostGroup.java:66)
at winstone.HostGroup.<init>(HostGroup.java:45)
at winstone.Launcher.<init>(Launcher.java:145)
at winstone.Launcher.main(Launcher.java:356)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at Main._main(Main.java:307)
at Main.main(Main.java:98)
我还需要做什么才能使Jenkins入门?
编辑:根据给定的建议输出…
[davea@mydevbox ~]$sudo useradd jenkins
[davea@mydevbox ~]$sudo chown -R jenkins:jenkins /usr/share/java/jenkins/jenkins.war
[davea@mydevbox ~]$
[davea@mydevbox ~]$sudo su - jenkins
[jenkins@mydevbox ~]$java -jar /usr/share/java/jenkins/jenkins.war
Running from: /usr/share/java/jenkins/jenkins.war
webroot: EnvVars.masterEnvVars.get("JENKINS_HOME")
Apr 21, 2016 4:46:08 PM winstone.Logger logInternal
INFO: Beginning extraction from war file
Apr 21, 2016 4:46:08 PM winstone.Logger logInternal
INFO: Winstone shutdown successfully
Apr 21, 2016 4:46:08 PM winstone.Logger logInternal
SEVERE: Container startup failed
java.io.FileNotFoundException: /usr/java/jboss/standalone/deployments/jenkins.war/war/META-INF/MANIFEST.MF (No such file or directory)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:221)
at java.io.FileOutputStream.<init>(FileOutputStream.java:171)
at winstone.HostConfiguration.getWebRoot(HostConfiguration.java:280)
at winstone.HostConfiguration.<init>(HostConfiguration.java:83)
at winstone.HostGroup.initHost(HostGroup.java:66)
at winstone.HostGroup.<init>(HostGroup.java:45)
at winstone.Launcher.<init>(Launcher.java:145)
at winstone.Launcher.main(Launcher.java:356)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at Main._main(Main.java:307)
at Main.main(Main.java:98)
解决方法:
我认为这是与许可相关的问题.
我猜该用户和组所有者设置为与jenkins尝试运行的用户不同的用户.尝试使用以下命令正确设置它:
$sudo chown -R <jenkins_user><jenkins_group> /usr/share/java/jenkins/