Maybe two months ago I installed the latest Jenkins on CentOS 7 following the instructions here, which includes installing Java OpenJDK 11. Linux
This was successful and I was able to run Jenkins and set up a single project. A month later I saw that an update was available for Jenkins, so I went through the process of installing the latest. Possibly I did something wrong here as I simply ran the command to install Jenkins again rather than update??? At any rate, it seemed successful, but then wouldn’t start. In short, it doesn’t seem to recognize Java anymore. All the answers I see on this appear to be out of date, for example, to edit /etc/init.d/jenkins and add java path. How do I verify/fix the Java path for the latest version of Jenkins on CentOS 7?
**sudo systemctl start jenkins**
Job for jenkins.service failed because the control process exited with error code. See "systemctl status jenkins.service" and "journalctl -xe" for details.
**sudo systemctl status jenkins**
â—Ź jenkins.service - Jenkins Continuous Integration Server
Loaded: loaded (/usr/lib/systemd/system/jenkins.service; enabled; vendor preset: disabled)
Active: failed (Result: start-limit) since Thu 2022-09-01 15:25:36 PDT; 5min ago
Main PID: 4512 (code=exited, status=1/FAILURE)
systemd[1]: jenkins.service: main process exited, code=exited, status=1/FAILURE
systemd[1]: Failed to start Jenkins Continuous Integration Server.
systemd[1]: Unit jenkins.service entered failed state.
systemd[1]: jenkins.service failed.
systemd[1]: jenkins.service holdoff time over, scheduling restart.
systemd[1]: Stopped Jenkins Continuous Integration Server.
systemd[1]: start request repeated too quickly for jenkins.service
systemd[1]: Failed to start Jenkins Continuous Integration Server.
systemd[1]: Unit jenkins.service entered failed state.
systemd[1]: jenkins.service failed.
**sudo journalctl -xe**
-- Unit jenkins.service has begun starting up.
systemd[1]: jenkins.service: main process exited, code=exited, status=1/FAILURE
jenkins[7170]: jenkins: failed to find a valid Java installation
systemd[1]: Failed to start Jenkins Continuous Integration Server.
-- Subject: Unit jenkins.service has failed