Jenkins 安装失败

Jenkins 安装失败

有人能帮助我在 Ubuntu 上安装 Jenkin 吗

我收到以下日志

Reading package lists... Done
Building dependency tree       
Reading state information... Done
jenkins is already the newest version (2.222.3).
0 upgraded, 0 newly installed, 0 to remove and 6 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
Setting up oracle-java11-installer-local (11.0.7-1~linuxuprising0) ...
Before installing this package,
please download the Oracle JDK 11 .tar.gz file
with the same version as this package (version 11.0.4),
and place it in /var/cache/oracle-jdk11-installer-local,

E.g.:
sudo mkdir -p /var/cache/oracle-jdk11-installer-local
sudo cp jdk-11.0.4_linux-x64_bin.tar.gz /var/cache/oracle-jdk11-installer-local/
sha256sum mismatch jdk-11.0.7_linux-x64_bin.tar.gz
Oracle JDK 11 is NOT installed.
dpkg: error processing package oracle-java11-installer-local (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up jenkins (2.222.3) ...
Job for jenkins.service failed because the control process exited with error code. See "systemctl status jenkins.service" and "journalctl -xe" for details.
invoke-rc.d: initscript jenkins, action "start" failed.
● jenkins.service - LSB: Start Jenkins at boot time
   Loaded: loaded (/etc/init.d/jenkins; bad; vendor preset: enabled)
   Active: failed (Result: exit-code) since Wed 2020-04-29 10:49:28 IST; 4ms ago
     Docs: man:systemd-sysv-generator(8)
  Process: 16643 ExecStart=/etc/init.d/jenkins start (code=exited, status=1/FAILURE)

Apr 29 10:49:28 ip-172-26-11-113 systemd[1]: Starting LSB: Start Jenkins at boot time...
Apr 29 10:49:28 ip-172-26-11-113 jenkins[16643]: Found an incorrect Java version
Apr 29 10:49:28 ip-172-26-11-113 jenkins[16643]: Java version found:
Apr 29 10:49:28 ip-172-26-11-113 jenkins[16643]: java version "13.0.2" 2020-01-14
Apr 29 10:49:28 ip-172-26-11-113 jenkins[16643]: Java(TM) SE Runtime Environment (build 13.0.2+8)
Apr 29 10:49:28 ip-172-26-11-113 jenkins[16643]: Java HotSpot(TM) 64-Bit Server VM (build 13.0.2+8, mixed mode, sharing)
Apr 29 10:49:28 ip-172-26-11-113 jenkins[16643]: Aborting
Apr 29 10:49:28 ip-172-26-11-113 systemd[1]: jenkins.service: Control process exited, code=exited status=1
Apr 29 10:49:28 ip-172-26-11-113 systemd[1]: Failed to start LSB: Start Jenkins at boot time.
Apr 29 10:49:28 ip-172-26-11-113 systemd[1]: jenkins.service: Unit entered failed state.
Apr 29 10:49:28 ip-172-26-11-113 systemd[1]: jenkins.service: Failed with result 'exit-code'.
dpkg: error processing package jenkins (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 oracle-java11-installer-local
 jenkins
E: Sub-process /usr/bin/dpkg returned an error code (1)

问题到底是什么?Jankins 需要哪个 Java 版本?我相信 Java-13 是一个相当新的版本,并且 Java 完全向后兼容。

答案1

我认为 Jenkins 正在尝试寻找 Oracle JDK 11。这写在上面的消息中

未安装 Oracle JDK 11。dpkg
:错误处理程序包 oracle-java11-installer-local(--configure):
子进程安装的安装后脚本返回错误退出状态 1

如果你正在安装 Jenkins,请在安装 Jenkins 之前安装 JDK 11。请按照以下适用于 Ubuntu 20.04 的教程进行操作
OpenJDK 安装

案例 - 2
如果安装了 Jenkins 并且它异常退出,exit code 1并且当您尝试获取状态时systemctl status jenkins.service,您会得到以下输出

Nov 13 09:35:43 tattve jenkins[1038744]: Found an incorrect Java version
Nov 13 09:35:43 tattve jenkins[1038744]: Java version found:
Nov 13 09:35:43 tattve jenkins[1038776]: openjdk version "11.0.9.1" 2020-11-04
Nov 13 09:35:43 tattve jenkins[1038776]: OpenJDK Runtime Environment (build 11.0.9.1+1-Ubuntu-0ubuntu1.20.04)
Nov 13 09:35:43 tattve jenkins[1038776]: OpenJDK 64-Bit Server VM (build 11.0.9.1+1-Ubuntu-0ubuntu1.20.04, mixed mode, sharing)
Nov 13 09:35:43 tattve jenkins[1038744]: Aborting

请实施建议的解决方案这里

相关内容