8

I am automation engineer i have deployed my build on the Jenkins using maven, I want to when scripts are executed then the browser should open. I searched on it some peoples says my me Run the Jenkins war file through cmd prompt when I am trying to Run the Jenkins through command prompt as:

java -jar Jenkins.war 

Then the system generates an error as follows:

SEVERE: Running with Java class version 53.0, but 52.0 is required error

Anyone have any idea how I can fix the problem?

enter image description here

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
mudassar munir
  • 355
  • 1
  • 4
  • 18

6 Answers6

10

This error message...

SEVERE: Running with Java class version 53.0, but 52.0 is required.

...implies that you have tried to initialize Jenkins on a system which is using java class version 53.0 which stands for Java 9.

As per the Jenkins documentation on Java requirements the following are mentioned:

  • Java 8 is the ONLY supported runtime environment, both 32-bit and 64-bit versions are supported.
  • Older versions of Java are not supported.
  • Java 9 is not supported.
  • Java 10 and Java 11 preview support is available.
  • Support of these versions is available through custom packages
  • Running Jenkins with Java 10 and 11 (experimental support) page provides guidelines about running Jenkins with these versions.
  • These requirements apply to all components of the Jenkins system including Jenkins master, all types of agents, CLI clients, and other components.

Solution

There are two possible solutions as follows:

  • You can downgrade your Jenkins host JRE to Java 8 version and initiate Jenkins as follows:

    ${JAVA8_HOME}/bin/java -jar jenkins.war
    
  • You can upgrade your Jenkins host JRE to Java 10 or Java 11 version and initiate Jenkins along with the --enable-future-java flag as follows:

    ${JAVA10_HOME}/bin/java -jar jenkins.war --enable-future-java
    

Running Jenkins (without Docker)

Java 10

  • Download Jenkins WAR for 2.127 or above (or build the experimental branch)
  • Run the Jenkins WAR file with the following command:

    ${JAVA10_HOME}/bin/java --add-modules java.xml.bind -jar jenkins.war \
        --enable-future-java --httpPort=8080 --prefix=/jenkins
    

Java 11

  • Download Jenkins WAR for 2.127 or above (or build the experimental branch)
  • Download the following libraries to the same directory as jenkins.war
  • Run the Jenkins WAR file with the following command:

    ${JAVA11_HOME}/bin/java \
        -p jaxb-api.jar:javax.activation.jar --add-modules java.xml.bind,java.activation \
        -cp jaxb-core.jar:jaxb-impl.jar \
        -jar jenkins.war --enable-future-java --httpPort=8080 --prefix=/jenkins
    

trivia

As per Java class file - Wikipedia following are the major version number of the class file format being used:

Java SE 11 = 55
Java SE 10 = 54
Java SE 9 = 53
Java SE 8 = 52
Java SE 7 = 51
Java SE 6.0 = 50
Java SE 5.0 = 49
JDK 1.4 = 48
JDK 1.3 = 47
JDK 1.2 = 46
JDK 1.1 = 45
undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
5
java -jar jenkins.war --enable-future-java
Jeremy Caney
  • 7,102
  • 69
  • 48
  • 77
Ashish
  • 61
  • 1
  • 2
2

I have installed Java 15 on my system. To run Jenkins with Java 15, please execute the below command.

D:\Selenium\Jenkins>java -jar jenkins.war -httpPort=9090 --enable-future-java

Change path to your war file.

Noman
  • 15
  • 6
1

Jenkins is supported java version are 8,11 . jenkins not supported older versions and java 9,10,12 and 13 too , you have to downgrade java version to 8 or 11

Justin Lambert
  • 940
  • 1
  • 7
  • 13
0

You have to install JDK8 and set system environment variable 'path' to JDK8 /bin/ folder

JanZ
  • 584
  • 2
  • 13
  • That means, you move back to Java 8. My Solution says that you can use Java 10 but instead of War you need to use Jenkins.exe solution – Ishita Shah Sep 28 '18 at 12:35
0

As of now, Jenkins WAR support is compatible up to Java 8.

You are using 9.0.4, Which is higher version from Jenkins recommendation

You can still use Jenkins, With Windows service: Click Here to Download

Ishita Shah
  • 3,955
  • 2
  • 27
  • 51
  • Thanks Your dedication , i had upgrade my jre-10.0.2 but still i am facing the error .jenkins required java 8 but you are running 10.0.2 – mudassar munir Sep 28 '18 at 11:01