Jenkins JRE Update

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.

  1. stop jenkins service
  2. edit in the jenkins base folder edit jenkins.xml -
<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>
  1. start jenkins