Tuesday, April 3, 2018

How to configure multiple JDKs for Jenkins

By default, Jenkins will build Java applications using whatever version of Java it finds on the system path, which is usually the version that Jenkins itself is running under. However, for a production build server, you will probably want more control than this. 
Jenkins provides good support for working with multiple JVMs. Indeed, Jenkins makes it very easy to configure and use as many versions of Java as you want. Like most system-level configuration, we do this in the Configure System screen. Here, you will find a section called JDK which allows you to manage the JDK installations you need Jenkins to work with.
Manage Jenkins -> Configure System -> JDK ( or https://your-jenkins-url/configure )



You can ask Jenkins to install Java for you. In this case, Jenkins will download the JDK installation and install a copy on your machine. The first time a build needs to use this JDK, Jenkins will download and install the specified version of Java into the tools directory in the Jenkins home directory. If the build is running on a new build agent that doesn’t have this JDK installed, it will download and install it onto the build agent machine as well.

If you use Jenkins’s Install automatically option, you don’t need to manually install all the JDK versions you need on the build agent machines—Jenkins will do it for you the first time it needs to.

The automatic installer will not work in all environments (if it can’t find or identify your operating system to its satisfaction, for example, the installation will fail), but it is nevertheless a useful and convenient way to set up new build servers or distributed build agents in a consistent manner.

See also: Jenkins

Featured Post

British-based startup ARC unveiled its first motorcycle model in Milan this week

One being described as fast, advanced and expensive. The so-called Vector costs more than $100,000