How To Install Gradle on Ubuntu 20.04 LTS

Install Gradle on Ubuntu 20.04

In this tutorial, we will show you how to install Gradle on Ubuntu 20.04 LTS. For those of you who didn’t know, Gradle is a general-purpose build tool used primarily for Java projects. It combines the best features of Ant and Maven. Gradle uses Groovy instead of using XML for scripting.

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and, most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account. If not, you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step installation Gradle on 20.04 LTS (Focal Fossa) server.

Install Gradle on Ubuntu 20.04 LTS Focal Fossa

Step 1. First, make sure that all your system packages are up-to-date by running these following aptcommands in the terminal.

Step 2. Installing Java.

Gradle requires Java to be installed on your server. So first of all, Make sure you have Java installed on your system:

Once the repository is added, proceed to install Java on Ubuntu Linux:

Then, type below to confirm the Java version:

Step 3. Installing Gradle on Ubuntu 20.04.

Run the commands to download the latest Gradle distribution release binary file from its official download page. At the time of writing this tutorial:

Then, extract the downloaded archive using the following command:

Step 4. Setup Environment Variables.

To configure the PATH environment variable to include the Gradle bin directory. create a new file named inside the /etc/profile.d/ directory as below:

Paste the following configuration:

Finally, load the environment variables using the following command:

Step 5. Verify the Gradle installation.

Finally, to verify if Gradle is installed properly use the gradle -v command which will display the Gradle version:

Congratulations! You have successfully installed Gradle. Thanks for using this tutorial for installing Gradle on Ubuntu 20.04 LTS Focal Fossa system. For additional help or useful information, we recommend you to check the official Gradle website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!