bhargav
bhargav

Reputation: 267

Jenkins service start error on red hat linux

The jenkins service does not start when ever i run jenkins service start . It says

 Starting Jenkins bash: /usr/bin/java: No such file or directory
                                                       [FAILED]

I have java installed at /usr/lib/jvm/jdk1.7.0_51. The JAVA_HOME variable is also set. Also tried adding this java to /etc/init.d/jenkins file. I need to use the sun jdk, not open jdk. Tried some of the alternatives from stackoverflow as well but did not work out. Any suggestions will be of great help.

Thanks, Bhargav

Upvotes: 0

Views: 3677

Answers (2)

Paul Hicks
Paul Hicks

Reputation: 13999

I'd guess that there's a script that has /usr/bin/java hardcoded. When you find the culprit, remove the /usr/bin so that it uses the default. Or you can change it to use the JAVA_HOME path, something like this:

JAVA_EXECUTABLE=$JAVA_HOME/bin/java
$JAVA_EXECUTABLE $JAVA_OPTS etc.. etc..

Upvotes: 0

bhargav
bhargav

Reputation: 267

Thanks Paul. The script inside /etc/sysconfig/jenkins needs to be edited. Else it uses the default java.

   JENKINS_JAVA_CMD="path of java installation"

Along with the above script, one can make changes to /etc/init.d/jenkins file if needed to add the path of java installation in your system.

Upvotes: 1

Related Questions