I am running a Jenkins server on Windows that is using the JRE in the Jenkins folder. The version is 1.8.0_66 but the Let's Encrypt certificate used by the Update Center is not compatible with this version, hence I need to update it.
Is there a stand-alone JRE available that I can replace the contents of this folder with, or is there a standard way of updating this JRE within Jenkins itself?
You can install Java on your local computer from here. Typically on Windows it would install it in a folder like C:\Program Files\Java\jdk1.8.0_161. Then just copy the JRE folder C:\Program Files\Java\jdk1.8.0_161\jre along with all its subfolders and files from your local computer to the JRE in the Jenkins folder (JAVA_HOME) so that you replace its contents. You can see JAVA_HOME from Jenkins System info. You can archive your old JRE installation files before that.
The second option is to install JRE on your Jenkins server directly from here. It will create a directory like this C:\Program Files\Java\jre1.8.0_161. Then you could copy this folder contents into the Jenkins_home/jre folder or the folder your Jenkins is using.
Third option is to install JRE on your Jenkins server and then change the JAVA_HOME variable so that Jenkins uses the standard folder for your operating system. More info here.
You may need to import your certificates into java keystore. See How to import a .cer certificate into a java keystore?
This is for windows users who happen to stumple upon this question (like I did). You need to have the system environment variable JAVA_HOME set.
<env name="JENKINS_HOME" value="%BASE%"/>
<!--
if you'd like to run Jenkins with a specific version of Java, specify a full path to java.exe.
The following value assumes that you have java in your PATH.
-->
<executable>%BASE%\jre\bin\java</executable>
<arguments>-Xrs -Xmx256m -Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle -jar "%BASE%\jenkins.war" --httpPort=8080 --webroot="%BASE%\war"</arguments>
change %BASE% to %JAVA_HOME% in "executable"
<env name="JENKINS_HOME" value="%BASE%"/>
<!--
if you'd like to run Jenkins with a specific version of Java, specify a full path to java.exe.
The following value assumes that you have java in your PATH.
-->
<executable>%JAVA_HOME%\jre\bin\java</executable>
<arguments>-Xrs -Xmx256m -Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle -jar "%BASE%\jenkins.war" --httpPort=8080 --webroot="%BASE%\war"</arguments>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With