I am trying to get Jenkins up and running on an RHEL7 machine. I have installed JDK 11 and Jenkins just fine. However, when trying to start Jenkins with systemctl, Jenkins fails to start and complains that it’s not able to find a valid Java installation.
Where does Jenkins look for Java binaries by default?
Is there an environment variable specific to Jenkins I can set to override this behavior? I have tried set ting $JAVA_HOME and have also added it to $PATH. I am able to invoke the Java binaries fine on their own.
Not the exact right response, but this canned response/template should give you all the details about jenkins and systemd. Nothing really reads .bashrc except your login.
Jenkins 2.332.1 switched Jenkins from using System V init to use systemd with its Linux package installers for Debian, Ubuntu, Red Hat, Alma, openSUSE, Rocky, and more. The LTS Upgrade Guide describes that transition and how to adapt your environment to the transition.