gradlew command not found - Debian

Page content

How to Install Gradle on Debian

Introduction

Gradle is a powerful build automation tool that is extensively used in the Java and Android development ecosystems. It allows developers to define their project structure, dependencies, and tasks in a concise and declarative manner. By automating the build process, Gradle helps streamline development workflows and ensures consistent and reliable builds.

In this tutorial, we will guide you through the process of installing Gradle on Debian, enabling you to leverage its capabilities for your own projects.

Step 1: Update Package Repositories

Before installing any new software, it’s always a good practice to ensure that your package repositories are up to date. You can do this by running the following command in your terminal:

sudo apt update

Step 2: Install OpenJDK

Gradle requires Java to be installed on your system. You can install OpenJDK, an open-source implementation of the Java Platform, by running the following command:

sudo apt install openjdk-11-jdk

Step 3: Download and Extract Gradle

Next, you need to download the latest version of Gradle from the official website. You can do this by visiting the Gradle downloads page and copying the link to the binary distribution. Once you have the link, use wget to download the Gradle archive:

wget <gradle_binary_distribution_url>

After downloading the archive, extract its contents to the desired location on your system. For example, you can extract it to /opt using the following command:

sudo tar -zxvf gradle-<version>.zip -C /opt

Step 4: Set Up Environment Variables

To use Gradle from any location in your terminal, you need to set up the PATH and GRADLE_HOME environment variables. Edit the .bashrc file in your home directory and add the following lines at the end:

export PATH=$PATH:/opt/gradle-<version>/bin
export GRADLE_HOME=/opt/gradle-<version>

Save the file and apply the changes by running:

source ~/.bashrc

Conclusion

Congratulations! You have successfully installed Gradle on your Debian system. You can now start using Gradle to automate your build tasks and improve your development process. If you encounter any issues or have any questions, feel free to refer to the Gradle documentation for more information and guidance.


The Importance of Open Source Software

Open source software plays a crucial role in the tech industry by fostering collaboration, innovation, and transparency. By making source code freely available, open source projects empower developers to learn from each other, contribute to shared solutions, and build upon existing technologies. The collective effort of the open source community has led to the creation of robust and reliable software that benefits users worldwide. Support for open source projects helps ensure their sustainability and continued development, ultimately driving progress and excellence in the digital landscape. Let’s continue to embrace and promote the principles of open source for a brighter future in technology.