Error message:
sudo systemctl start jenkins
Job for jenkins.service failed because the control process exited with error code.
See “systemctl status jenkins.service” and “journalctl -xeu jenkins.service” for details.
It’s hard to help when all you write that it failed without providing any details. Have you checked the output of journalctl -u jenkins?
It will most likely tell you what is wrong
Jul 18 22:50:12 venom-linux systemd[1]: jenkins.service: Start request repeated too quickly.
Jul 18 22:50:12 venom-linux systemd[1]: jenkins.service: Failed with result ‘exit-code’.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: Enterprise open source support | Ubuntu
░░
░░ The unit jenkins.service has entered the ‘failed’ state with result ‘exit-code’.
Jul 18 22:50:12 venom-linux systemd[1]: Failed to start Jenkins Continuous Integration Server.
░░ Subject: A start job for unit jenkins.service has failed
░░ Defined-By: systemd
░░ Support: Enterprise open source support | Ubuntu
░░
░░ A start job for unit jenkins.service has finished with a failure.
░░
░░ The job identifier is 17915 and the job result is failed.
The simplest method is probably to remove the Java 22 package from the operating system package manager. That should change the operating system to use one of the other Java versions that you have installed.
The more explicit method is to define the path to Java in the systemd configuration. The managing systemd services page provides more details.
On my Ubuntu 22.04, computer, when I run systemctl edit jenkins, it includes the following comments as hints of changes you might need:
# # The Java home directory. When left empty, JENKINS_JAVA_CMD and PATH are consulted.
# #Environment="JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64"
#
# # The Java executable. When left empty, JAVA_HOME and PATH are consulted.
# #Environment="JENKINS_JAVA_CMD=/etc/alternatives/java"