Trying to install Jenkins but it is showing me this error.
Jenkins requires Java versions [8, 11] but you are running
with Java 16 from C:\Program Files\Java\jdk-16.0.1
Please help!
Trying to install Jenkins but it is showing me this error.
Jenkins requires Java versions [8, 11] but you are running
with Java 16 from C:\Program Files\Java\jdk-16.0.1
Please help!
C:\Program Files\Java\
since I have already installed java 16, I don't want to change the default to 11.
Run Jenkins as mentioned below:
open command prompt using run as administrator mode
switch to >>>
C:\Windows\system32>
>>
cd C:\Program Files\Jenkins
Execute this command
C:\Program Files\Jenkins>..\Java\jdk-11.0.12\bin\java -jar jenkins.war --httpPort=8080
Go to HTTP://localhost:8080
You can find admin password from C:\Users\myuser\\.jenkins\secrets\initialAdminPassword
In my case, I was not able to fix it with the above solutions. So, what worked for me is, in environment variables, you can update the path of JAVA_HOME as C:\Program Files\Java\jdk1.8.0_321
or the specific path in which you have your java installed. The advantage here is you need not delete the other versions of java. Also remember you need to delete C:\Program Files\Common Files\Oracle\Java\javapath
C:\Program Files (x86)\Common Files\Oracle\Java\javapath
from the existing system variables so that it will consider version 8 as default.
Also need to update the java version pointing in the jenkins to jdk1.8.0_321 in the C:\Program Files\Jenkins\jenkins.xml file
<executable>C:\Program Files\Java\jdk1.8.0_321\bin\java.exe</executable>
Create 2 batch files using solution provided by
Bala Subramanium
so u can start Jenkins with one/two click/s
First Bat File is Jenkins_Initiate.bat ------>>>>> (use to start Jenkins)
cd C:\Program Files\Jenkins
..\Java\jdk-11.0.13\bin\java -jar jenkins.war --httpPort=8080
make sure to have 2 spaces between java & -jar
Second Bat File is Jenkins_Launch.bat ------>>>>> (use to lauch Jenkins on chrome)
start chrome http://localhost:8080
You can use the option —enable-future-java. You can run jenkins.war on command prompt with the above option. Or you can edit xml file jenkins within your installed Jenkins package to add this option. The following blog discusses this solution. https://medium.com/@rakhi.mundhada1/how-to-run-jenkins-with-java-17-on-a-windows-machine-2a1b1c50960a Same can be applied to Java 16.