Make Jenkins Windows Service use your Preferred JRE
Join the DZone community and get the full member experience.
Join For Freerecently 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. fortunately 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
<executable>%base%\jre\bin\java</executable>
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.
that’s it!
enjoy!
Published at DZone with permission of Patroklos Papapetrou, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.
Comments