How to install Gradle on Debian 10?
Last updated
Last updated
Gradle is a build automation tool that is used to create a variety of applications, including microservices and mobile apps. Applications may be built, tested, and maintained using the Gradle framework. Furthermore, if you are working on a multi-build project, Gradle continuously checks your work to see whether you have made any changes.
This tutorial explains you how to setup Gradle on Debian 10.
There are certain prerequisites that need to be met before you begin.
A machine running Debian 10
A root user having Sudo privileges
Internet connection
Always be sure to update your system before downloading the latest packages. Run the following command to do it:
Since Java is a prerequisite for Gradle, we will first install the most recent version of Java that is accessible in the default repository. Type the following command to set up the OpenJDK package:
Run the below command to check the Java version installed:
You should go through the Gradle releases page to determine whether a newer version is accessible.
Use the wget command to get the Gradle binary file:
Unzip the zip file in the /opt/gradle directory when the download is completed.
Make sure the Gradle files have been extracted by checking with the following command:
The Gradle bin directory must be included in the PATH environment variable, which needs to be configured next. To achieve this, launch your text editor and make a new file called gradle.sh inside the /etc/profile.d directory.
Paste the following lines as shown below in the /etc/profile.d/gradle.sh:
Save and exit the file. This script will be loaded when the shell launches.
Run the chmod command to modify the file's access mode, allowing it to be read-only or write-only:
The environment variables that we specified for Gradle in the present environment must be initialised. Run the following command to do so:
Run the command below, which will show the Gradle version, to make sure Gradle is installed correctly:
Gradle has been successfully installed on your Debian 10 system, and you can now use it.
In this tutorial, we have successfully mastered the steps required to install Gradle on Debian 10 as well as all the necessary commands.