zoukankan      html  css  js  c++  java
  • jenkins启动失败 jenkins.service failed Starting Jenkins bash: /usr/bin/java: 没有那个文件或目录

    失败的原因

    ● jenkins.service - LSB: Jenkins Automation Server
       Loaded: loaded (/etc/rc.d/init.d/jenkins; bad; vendor preset: disabled)
       Active: failed (Result: exit-code) since 二 2020-05-19 20:40:51 CST; 3min 27s ago
         Docs: man:systemd-sysv-generator(8)
      Process: 1880 ExecStart=/etc/rc.d/init.d/jenkins start (code=exited, status=1/FAILURE)
    
    5月 19 20:40:50 localhost.localdomain systemd[1]: Starting LSB: Jenkins Automation Server...
    5月 19 20:40:51 localhost.localdomain runuser[1885]: pam_unix(runuser:session): session opened for user root by (uid=0)
    5月 19 20:40:51 localhost.localdomain jenkins[1880]: Starting Jenkins bash: /usr/bin/java: 没有那个文件或目录
    5月 19 20:40:51 localhost.localdomain systemd[1]: jenkins.service: control process exited, code=exited status=1
    5月 19 20:40:51 localhost.localdomain jenkins[1880]: [失败]
    5月 19 20:40:51 localhost.localdomain systemd[1]: Failed to start LSB: Jenkins Automation Server.
    5月 19 20:40:51 localhost.localdomain systemd[1]: Unit jenkins.service entered failed state.
    5月 19 20:40:51 localhost.localdomain systemd[1]: jenkins.service failed.
    

    解决方案

    启动异常,没有/usr/bin/java目录

    修改配置文件vi /etc/init.d/jenkins

    candidates="
    /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/lib/jvm/java-11.0/bin/java
    /usr/lib/jvm/jre-11.0/bin/java
    /usr/lib/jvm/java-11-openjdk-amd64
    /usr/bin/java
    /usr/local/jdk1.8.0_171/bin/java  #这一排是自己的java环境地址
    "
    

    解决方案2软连接

    ln -s /usr/local/jdk1.8.0_161/bin/java /usr/bin/java

  • 相关阅读:
    取消Git代理设置
    在Go语言中使用JSON(去掉空字段)
    go-- 用go-mssql驱动连接sqlserver数据库
    Go加密解密之DES
    Go语言interface详解
    Go--避免SQL注入
    golang: 把sql结果集以json格式输出
    Golang操作数据库
    Oracle ORA-01555(快照过旧)
    racle undo 解析
  • 原文地址:https://www.cnblogs.com/TJ21/p/13302974.html
Copyright © 2011-2022 走看看