Gradle is an open supply construct automation system used primarily for Java initiatives. It combines the perfect options of Ant and Maven. Not like its predecessors which use XML for scripting, Gradle makes use of Groovy, a dynamic, object-oriented programming language for the Java platform to outline the mission and construct scripts.

This tutorial outlines the steps vital to put in the most recent model of Gradle on CentOS 7 methods.

Stipulations

The person you’re logging in as will need to have sudo privileges to have the ability to set up packages.

Putting in Gradle on CentOS

The next sections present details about methods to set up Gradle on CentOS 7. We’ll obtain the most recent launch of Gradle from their official web site.

2. Obtain Gradle

On the time of writing this text, the most recent model of Gradle is 5.0. Earlier than persevering with with the following step you need to verify the Gradle releases web page to see if a more recent model is on the market.

Begin by downloading the Gradle Binary-only zip file within the /tmp listing utilizing the next wget command:

3. Setup setting variables

The following step is to configure the PATH setting variable to incorporate the Gradle bin listing. To take action, open your textual content editor and create a brand new file named gradle.sh inside the /and many others/profile.d/ listing.

sudo nano /and many others/profile.d/gradle.sh

Paste the next configuration:

/and many others/profile.d/gradle.sh

export GRADLE_HOME=/choose/gradle/gradle-5.0
export PATH=$/bin:$

Save and shut the file. This script will likely be sourced at shell startup.

Make the script executable by typing:

sudo chmod +x /and many others/profile.d/gradle.sh

Load the setting variables utilizing the next command:

supply /and many others/profile.d/gradle.sh

4. Confirm the Gradle set up

To validate that Gradle is put in correctly use the gradle -v command which is able to show the Gradle model: