jenkins 启动时报错:Starting Jenkins bash: /usr/bin/java: No such file or directory

安装jekins:

wget -O /etc/yum.repos.d/jenkins.repohttps://pkg.jenkins.io/redhat-stable/jenkins.repo

rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key

yum install jenkins 

执行

servicejenkins start 时,报错如下:


按照提示执行:systemctl status jenkins.service,提示如下:


发现是找不到jdk,修改文件:

vim  /etc/init.d/jenkins

  1. candidates="
    /setup/tools/jdk1.8.0_144/bin/java #此处为加入的java路径
    /etc/alternatives/java
    /usr/lib/jvm/java-1.8.0/bin/java
    /usr/lib/jvm/jre-1.8.0/bin/java
    /usr/lib/jvm/java-1.7.0/bin/java
    /usr/lib/jvm/jre-1.7.0/bin/java
    /usr/bin/java
vim  /etc/sysconfig/jenkins


  1. do  
  2.   [ -x "$JENKINS_JAVA_CMD" ] && break  
  3.   JENKINS_JAVA_CMD="$candidate"  
  4. done  

重新执行:

[root@mircoserver data]# systemctl daemon-reload
[root@mircoserver data]# service jenkins start 

问题解决。


你可能感兴趣的:(jekins)