jenkins 安装期间出错:无法启动 LSB:在启动时启动 jenkins

Error during jenkins installation : failed to start LSB : start jenkins at boot time

你好,我收到这个错误,无论我怎么尝试都没有解决它

● jenkins.service - LSB: Start Jenkins at boot time
     Loaded: loaded (/etc/init.d/jenkins; generated)
     Active: failed (Result: exit-code) since Mon 2022-02-28 09:07:36 CET; 7ms ago
       Docs: man:systemd-sysv-generator(8)
    Process: 10513 ExecStart=/etc/init.d/jenkins start (code=exited, status=1/FAILURE)

févr. 28 09:07:36 tristanpc systemd[1]: Starting LSB: Start Jenkins at boot time...
févr. 28 09:07:36 tristanpc jenkins[10513]: Found an incorrect Java version
févr. 28 09:07:36 tristanpc jenkins[10513]: Java version found:
févr. 28 09:07:36 tristanpc jenkins[10535]: openjdk version "16.0.1" 2021-04-20
févr. 28 09:07:36 tristanpc jenkins[10535]: OpenJDK Runtime Environment (build 16.0.1+9-Ubuntu-120.04)
févr. 28 09:07:36 tristanpc jenkins[10535]: OpenJDK 64-Bit Server VM (build 16.0.1+9-Ubuntu-120.04, mixed mode, sharing)
févr. 28 09:07:36 tristanpc jenkins[10513]: Aborting
févr. 28 09:07:36 tristanpc systemd[1]: jenkins.service: Control process exited, code=exited, status=1/FAILURE
févr. 28 09:07:36 tristanpc systemd[1]: jenkins.service: Failed with result 'exit-code'.
févr. 28 09:07:36 tristanpc systemd[1]: Failed to start LSB: Start Jenkins at boot time.
dpkg: erreur de traitement du paquet jenkins (--configure) :
 installed jenkins package post-installation script subprocess returned error exit status 1

我使用了这个安装步骤

curl -fsSL https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo tee \
  /usr/share/keyrings/jenkins-keyring.asc > /dev/null
echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] \
  https://pkg.jenkins.io/debian-stable binary/ | sudo tee \
  /etc/apt/sources.list.d/jenkins.list > /dev/null
sudo apt-get update
sudo apt-get install jenkins

java版本

openjdk version "16.0.1" 2021-04-20
OpenJDK Runtime Environment (build 16.0.1+9-Ubuntu-120.04)
OpenJDK 64-Bit Server VM (build 16.0.1+9-Ubuntu-120.04, mixed mode, sharing)

我正在使用 ubuntu

Java 8 或 Java 11 (recommended) are required。安装 11.

另外,不管你在 Java 16, that is deprecated 上 运行 是什么。移动到 17 或 11。