在Ubuntu 18.04.4上安装Jenkins。詹金斯没有开始

时间:2019-01-09 10:58:16

标签: linux ubuntu jenkins ubuntu-18.04

信息:

根据我在此处成功发布的信息,将Java成功更新到版本8之后,Jenkins也已安装。尽管出现了Ubuntu 18.04.04下的错误消息,但Jenkins不想启动,但我还是得到了

安装步骤以重制

这些步骤包含在Java 8的Ubunto 18.04下也应该安装Jenkins的过程?在Ubuntu 18.04.04下也是如此吗?

 sudo add-apt-repository ppa:webupd8team/java
    sudo apt install oracle-java8-installer
    wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo apt-key add -
    sudo apt-add-repository "deb https://pkg.jenkins.io/debian-stable binary/"
    sudo apt install jenkins

安装后的问题概述

jenkins.service - LSB: Start Jenkins at boot time
   Loaded: loaded (/etc/init.d/jenkins; generated)
   Active: failed (Result: exit-code) since Wed 2019-01-09 11:47:20 CET; 3min 6s
     Docs: man:systemd-sysv-generator(8)
  Process: 692 ExecStart=/etc/init.d/jenkins start (code=exited, status=1/FAILUR

Jan 09 11:47:19 Jenkins systemd[1]: Starting LSB: Start Jenkins at boot time...
Jan 09 11:47:19 Jenkins jenkins[692]: Found an incorrect Java version
Jan 09 11:47:19 Jenkins jenkins[692]: Java version found:
Jan 09 11:47:20 Jenkins jenkins[692]: openjdk version "10.0.2" 2018-07-17
Jan 09 11:47:20 Jenkins jenkins[692]: OpenJDK Runtime Environment (build 10.0.2+
Jan 09 11:47:20 Jenkins jenkins[692]: OpenJDK 64-Bit Server VM (build 10.0.2+13-
Jan 09 11:47:20 Jenkins jenkins[692]: Aborting
Jan 09 11:47:20 Jenkins systemd[1]: jenkins.service: Control process exited, cod
Jan 09 11:47:20 Jenkins systemd[1]: jenkins.service: Failed with result 'exit-co
Jan 09 11:47:20 Jenkins systemd[1]: Failed to start LSB: Start Jenkins at boot t
lines 1-16/16 (END)

2 个答案:

答案 0 :(得分:1)

您安装了OracleJDK,但Jenkins找到了OpenJDK

尝试

sudo update-alternatives --config java

答案 1 :(得分:0)

感谢@GaRaOne,选择正确的 Java 版本对我有帮助:

$ sudo update-alternatives --config java 
There are 2 choices for the alternative java (providing /usr/bin/java).

  Selection    Path                                            Priority   Status
------------------------------------------------------------
  0            /usr/lib/jvm/java-11-openjdk-amd64/bin/java      1111      auto mode
  1            /usr/lib/jvm/java-11-openjdk-amd64/bin/java      1111      manual mode
* 2            /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java   1081      manual mode