java.io.IOException: Cannot run program "/opt/jdk1.8.0_191/bin/java" (in directory "/var/lib/jenkins/workspace/xinguan"): error=2, No such file or directory

测试jenkins构建,报错如下

Parsing POMs
Established TCP socket on 44463
[xinguan] $ /opt/jdk1.8.0_191/bin/java -cp /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven35-agent-1.13.jar:/opt/maven-3.6/boot/plexus-classworlds-2.5.2.jar:/opt/maven-3.6/conf/logging jenkins.maven3.agent.Maven35Main /opt/maven-3.6 /var/cache/jenkins/war/WEB-INF/lib/remoting-3.33.jar /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven35-interceptor-1.13.jar /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-commons-1.13.jar 44463
ERROR: Failed to parse POMs
java.io.IOException: Cannot run program "/opt/jdk1.8.0_191/bin/java" (in directory "/var/lib/jenkins/workspace/xinguan"): error=2, No such file or directory
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
    at hudson.Proc$LocalProc.(Proc.java:250)
    at hudson.Proc$LocalProc.(Proc.java:219)
    at hudson.Launcher$LocalLauncher.launch(Launcher.java:937)
    at hudson.Launcher$ProcStarter.start(Launcher.java:455)
    at hudson.maven.AbstractMavenProcessFactory.newProcess(AbstractMavenProcessFactory.java:280)
    at hudson.maven.ProcessCache.get(ProcessCache.java:236)
    at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:804)
    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504)
    at hudson.model.Run.execute(Run.java:1815)
    at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:543)
    at hudson.model.ResourceController.execute(ResourceController.java:97)
    at hudson.model.Executor.run(Executor.java:429)
Caused by: java.io.IOException: error=2, No such file or directory
    at java.lang.UNIXProcess.forkAndExec(Native Method)
    at java.lang.UNIXProcess.(UNIXProcess.java:247)
    at java.lang.ProcessImpl.start(ProcessImpl.java:134)
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
    ... 12 more
Finished: FAILURE

手动确定了 /opt/jdk1.8.0_191/bin/java/var/lib/jenkins/workspace/xinguan 都是正常存在的目录,但还是报错没有文件或目录

于是乎手动执行了一下上面提示的命令:

[root@harbor jdk1.8.0_191]# /opt/jdk1.8.0_191/bin/java -cp /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven35-agent-1.13.jar:/opt/maven-3.6/boot/plexus-classworlds-2.5.2.jar:/opt/maven-3.6/conf/logging jenkins.maven3.agent.Maven35Main /opt/maven-3.6 /var/cache/jenkins/war/WEB-INF/lib/remoting-3.33.jar /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven35-interceptor-1.13.jar /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-commons-1.13.jar
-bash: /opt/jdk1.8.0_191/bin/java: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory

哦吼,问题出来了,缺少依赖包glibc.i686,安装

yum install glibc.i686 -y

你可能感兴趣的:(java.io.IOException: Cannot run program "/opt/jdk1.8.0_191/bin/java" (in directory "/var/lib/jenkins/workspace/xinguan"): error=2, No such file or directory)