How to Install Gradle on Debian Latest

Gradle is an open-source build automation tool used primarily for Java projects. It automates the building, testing, and deployment of applications. In this tutorial, we will show you how to install Gradle on Debian Latest.

Prerequisites

Before starting with the installation process, ensure that the following prerequisites are met:

  • A Debian Latest system

  • sudo access to the system

  • Java JDK installation on the system. If Java is not installed, install it using the following command in the terminal:

    sudo apt-get install openjdk-11-jdk
    

Install Gradle

To install Gradle on Debian Latest, follow the steps below:

  1. Open your terminal by pressing Ctrl+Alt+T on your keyboard.

  2. Update your system's package list by running the following command:

    sudo apt-get update
    
  3. Install the necessary tools and packages by running the following command:

    sudo apt-get install wget unzip
    
  4. Navigate to the official Gradle website and copy the link to the latest version of Gradle. At the time of writing this tutorial, the latest version of Gradle is 7.2.

    https://gradle.org/releases/
    
  5. Go back to your terminal and execute the following command to download the latest version of Gradle:

    wget https://downloads.gradle-dn.com/distributions/gradle-7.2-bin.zip
    
  6. Extract the downloaded file using the following command:

    unzip gradle-7.2-bin.zip -d /opt/
    
  7. The extracted folder will be named gradle-7.2. Rename it to simply gradle:

    sudo mv /opt/gradle-7.2/ /opt/gradle/
    
  8. You also need to set up the PATH environment in order to use Gradle in a terminal. Add the following lines to the end of the /etc/profile file:

    PATH=$PATH:/opt/gradle/bin
    export PATH
    
  9. Save and exit the file.

  10. Load the updated PATH environment by running the following command:

    source /etc/profile
    
  11. Verify that Gradle is installed correctly by running the following command:

    gradle -v
    
  12. If Gradle is installed correctly, you should see the following output:

    Welcome to Gradle 7.X!
    
    Here are the highlights of this release:
     - ......
     
    Gradle 7.X build time:  .....
    Kotlin: ......
    Groovy: ......
    JVM: ......
    

    Congratulations! Gradle is now installed on your Debian Latest system.

Conclusion

In this tutorial, we showed you how to install Gradle on Debian Latest. Gradle is a powerful tool that can help you automate the building, testing and deployment of your projects efficiently.