Only Software matters

Experiences in software development

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

 <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!

 

About these ads

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
Follow

Get every new post delivered to your Inbox.

Join 628 other followers

%d bloggers like this: