M BUZZ CRAZE NEWS
// general

How to configure Java for Jenkins on Ubuntu

By Joseph Russell

I have a VM with Ubuntu 18.04 with JDK 12 as default java in it. I want to setup a Jenkins server on it and as it do not support JDK 12 yet, i have installed JRE 8 in it to support Jenkins.

How to configure Jenkins such that it will use this JRE8 instead of JDK12??

1 Answer

After understanding how Jenkins allows us to override configuration and debugging init script, i found multiple ways to tackle this situation.

  1. Override PATH variable in /etc/default/jenkins(I prefer this solution) PATH=<PATH to your JAVA>

  2. Modify PATH variable in /etc/init.d/jenkins(prefix your path to java) PATH=<PATH to your JAVA>:/bin:/usr/bin:/sbin:/usr/sbin

  3. Force Jenkins to use Java that you specify in /etc/init.d/jenkins JAVA='<PATH to your JAVA>/java'

Note: <PATH to your JAVA> is an absolute path to your java location For E.g. 1. /usr/lib/jvm//bin in case of JDK 2. /usr/lib/jvm//jre/bin in case of JRE

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy