Linux – way to change the java JRE a linux Jenkins server uses

javaJenkinslinux

A Jenkins server is running under Java 1.7 on a linux machine and I need to change it to 1.8 so that I can run a specific plugin.

The Linux machine has a Java 1.8 JDK/JRE installed, but I cant find a way to tell the Jenkins server to use it? I've found guides on Windows servers how to do this, but nothing that relates or transfers to Linux Jenkins servers.

Is there a way to change the JRE used by the Jenkins server on linux?

Like a linux version of this: https://dzone.com/articles/make-jenkins-windows-service

Best Answer

Depending on the distribution, you will have one of "/etc/sysconfig/jenkins" or "/etc/default/jenkins".

This will have a property to set the java home location. Usually all the options are commented out to show what the file can configure.