Gradle is an open-source build automation tool; Java projects mostly uses Gradle. It automates the building process of applications which includes compiling, linking, and packaging of code without manual input. Gradle also supports Groovy, which is an object-oriented dynamic language for Java applications. Gradle combines the best features of Ant and Maven. Unlike its predecessors, which use XML for scripting, Gradle uses Groovy , a dynamic, object-oriented programming language for the Java platform to define the project and build scripts. In this tutorial we will Install Gradle on Ubuntu.
Install Open JDK:
Gradle requires Open JDK. Install it using the following command:
apt install openjdk-11-jdk
Verify the installation of Java using the following command:
Install Gradle on Ubuntu:
As of now gradle version is 7.4.2. Download the latest binary of gradle using the following command:
Unzip the file using the following command:
Now that the installation of Gradle in complete. Please set the environment variables in a file using the following command:
Add the following lines in the file:
save and close the file.
Give the file executable rights using the following command:
chmod +x /etc/profile.d/gradle.sh
Load the environment variables using the following command;
Verify the Gradle installation using the following command:
Gradle installation is complete now. You can use it according to your need.