kiran
kiran

Reputation: 4409

Unable to setup Jenkins war with java command

I am trying to setup Jenkins on first step I got following error when running the command "java -jar jenkins.war"

SEVERE: Running with Java class version 55.0, but 52.0 is required.Run with the --enable-future-java flag to enable such behavior. See https://jenkins.io/redirect/java-support/
java.lang.UnsupportedClassVersionError: 55.0
    at Main.main(Main.java:139)

Jenkins requires Java 8, but you are running 11.0.1+13-LTS from /Library/Java/JavaVirtualMachines/jdk-11.0.1.jdk/Contents/Home
java.lang.UnsupportedClassVersionError: 55.0
    at Main.main(Main.java:139)

Can any one guild me how to fix this?

Upvotes: 1

Views: 10935

Answers (4)

Mark Wandatha
Mark Wandatha

Reputation: 11

If you have more Recent Java version installed, Run

java -jar jenkins.war --enable-future-java --httpPort=xxxx   

Upvotes: 0

Avinash
Avinash

Reputation: 1

  1. Download JDK 11 version as ZIp version
  2. Open Command Prompt or terminal
  3. set PATH=<Path of JDK 11 or JDK8 Bin folder>;%PATH% (For windows)
  4. Check for Java -version, it shows JDK 11 or 8
  5. Run java -jar jenkins.war -httpPort=

Upvotes: 0

RAHUL KUMAR
RAHUL KUMAR

Reputation: 31

It works with "java -jar jenkins.war --enable-future-java --httpPort=9090".

Steps:

  1. Go to directory where Jenkins.war is places
  2. open cmd
  3. Enter java -jar jenkins.war --enable-future-java --httpPort=9090

Jenkins will start. then Go to "http://localhost:9090/" and enter "initialAdminPassword" then Jenkins will start properly.

Upvotes: 3

Gergely Bacso
Gergely Bacso

Reputation: 14651

I think the errormessage is quite clear. You are trying to run Jenkins with Java version 11, while it would prefer Java 8.

According to the documentation Java 11 is not fully supported yet, but as the errormessage suggest, you can make it work by using the --enable-future-java flag via command line.

The more safe option is to install and use the Java version preferred by the Jenkins team, which is Java 8 at this point. For that you need to install of course that version on your machine first.

Upvotes: 5

Related Questions