Starting Jenkins bash: /usr/bin/java: No such file or directory

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/fly910905/article/details/80091025

问题描述

在CentOS 6.5上启动Jenkins 

service jenkins start

报错

Starting Jenkins bash: /usr/bin/java: No such file or directory
                                                       [FAILED]

问题分析

JDK的安装路径和Jenkins 默认的JDK路径不一致

[root@iZbp14w0b2rs7i1400bjjmZ ~]# echo $JAVA_HOME
/usr/local/jdk1.8.0_121/jdk
[root@iZbp14w0b2rs7i1400bjjmZ ~]# echo $PATH
/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/jdk1.8.0_121/jdk/bin:/root/bin
[root@iZbp14w0b2rs7i1400bjjmZ ~]# which java
/usr/local/jdk1.8.0_121/jdk/bin/java

问题解决

建立软连接

ln -s /usr/local/jdk1.8.0_121/jdk/bin/java /usr/bin/java

使用which java验证,发现地址已经改变

[root@iZbp14w0b2rs7i1400bjjmZ ~]# which java
/usr/bin/java

展开阅读全文

没有更多推荐了,返回首页