Make jenkins Windows service use your preferred JRE
Posted by Patroklos Papapetrou on November 21, 2013
Recently I was working on installing and configuring a new instance of Jenkins. For some reason, which is out of this post’s context, I wanted to make Jenkins run with a specific version of the Java environment. Forutenately it was something really easy. This post is mainly a reminder to me, next time I’d like to do the same
Jenkins by default uses the jre which located under the jre sub-directory of your jenkins installation home ( %JENKINS_HOME ).
To change this find the file named jenkins.xml in which is located in your %JENKINS_HOME directory.
Edit it and look for the following section
Now change the content of the executable property to point to your favorite JRE. You can describe it as an absolute or relative path or you can even use, environment variables.
Save the file and restart Jenkins.