Jenkins配置linux节点报错
[08/20/18 11:29:29] [SSH] Starting sftp client.
[08/20/18 11:29:29] [SSH] 正在拷贝最新版本的 slave.jar...
[08/20/18 11:29:30] [SSH] Copied 771,004 bytes.
Expanded the channel window size to 4MB
[08/20/18 11:29:30] [SSH] Starting slave process: cd " /home/system1/jenkins21" && /usr/lib/jvm/java-7-openjdk-amd64/ -jar slave.jar
bash: /usr/lib/jvm/java-7-openjdk-amd64/: Is a directory
Slave JVM has terminated. Exit code=126
[08/20/18 11:29:30] Launch failed - cleaning up connection
[08/20/18 11:29:30] [SSH] 连接关闭。
修改节点配置中的JAVA配置为1.8版本就可以了

Jenkins任务编译报错1
FATAL: Remote call on Ubu_10.250.115.100 failed
Also: hudson.remoting.ChannelExceptionResponse.retrieve(UserRequest.java:357)
at hudson.remoting.Channel.call(Channel.java:955)
at hudson.LauncherAbstractBuildExecution.run(AbstractBuild.java:510)
at hudson.model.Run.execute(Run.java:1798)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)
java.lang.NoClassDefFoundError: Could not initialize class hudson.slaves.SlaveComputer
at hudson.util.ProcessTree.get(ProcessTree.java:399)
at hudson.LauncherKillTask.call(Launcher.java:1090)
at hudson.LauncherKillTask.call(Launcher.java:1081)
at hudson.remoting.UserRequest.perform(UserRequest.java:212)
at hudson.remoting.UserRequest.perform(UserRequest.java:54)
at hudson.remoting.Request1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutorRemoteLauncher.kill(Launcher.java:1078)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:510)
at hudson.model.Run.execute(Run.java:1798)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)
原因和解决办法
原本在系统设置-全局环境变量-JDK中填写了windows的jdk路径,这样导致了jenkins找不到java环境,去掉这个jdk配置后,重启jenkins就好了
网友评论