Sunday, May 21, 2017

Error while starting jenkins

Today, when I install and setup Jenkins, I am getting the following error while starting the jenkins service.

OS : CentOS release 6.8 (Final)

Following is the error:

Running from: /usr/lib/jenkins/jenkins.war
May 21, 2017 7:38:37 PM Main deleteWinstoneTempContents
WARNING: Failed to delete the temporary Winstone file /tmp/winstone/jenkins.war
Jenkins requires Java7 or later, but you are running 1.7.0_131-mockbuild_2017_02_13_15_19-b00 from /usr/lib/jvm/java-1.7.0-openjdk-
java.lang.UnsupportedClassVersionError: winstone/Launcher : Unsupported major.minor version 52.0
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(
        at Method)
        at java.lang.ClassLoader.loadClass(
        at java.lang.ClassLoader.loadClass(
        at Main._main(
        at Main.main(

Solution to fix the issue:

1. Take the backup of /etc/init.d/jenkins to a safe location.
2.  update-alternatives --config java (to the latest java) 
3. Update the file /etc/init.d/jenkins after candidates with your result of echo $JAVA_HOME

The  /etc/init.d/jenkins snippet is below
# Search usable Java as /usr/bin/java might not point to minimal version required by Jenkins.
# see

4. Restart jenkins

No comments:

Post a Comment