gradlew command not found - Amazon Linux

Page content

How to Install Gradle on Amazon Linux

In this tutorial, we will guide you through the process of installing Gradle on Amazon Linux. Gradle is a powerful build automation tool that is used primarily for Java projects. It helps in managing dependencies, compiling code, running tests, and packaging applications. By installing Gradle on your Amazon Linux system, you can streamline your Java project builds and improve overall development efficiency.

Step 1: Update Package Repository

Before installing Gradle, it is always recommended to update the package repository on your Amazon Linux system. This ensures that you have the latest information about available packages and dependencies.

sudo yum update

Step 2: Install Java Development Kit (JDK)

Gradle requires Java Development Kit (JDK) to be installed on your system. If you don’t have JDK installed, you can do so using the following command:

sudo yum install java-1.8.0-openjdk

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.

wget <Gradle binary distribution link>
sudo mkdir /opt/gradle
sudo unzip -d /opt/gradle <downloaded file>

Step 4: Configure Environment Variables

To use Gradle globally on your system, you need to set the PATH environment variable to include the Gradle bin directory. You can do this by editing the .bashrc file:

echo "export PATH=$PATH:/opt/gradle/bin" >> ~/.bashrc
source ~/.bashrc

Step 5: Verify Installation

To verify that Gradle has been successfully installed, you can run the following command:

gradle -v

If everything is set up correctly, you should see the Gradle version information displayed in the terminal.

Conclusion

Congratulations! You have successfully installed Gradle on your Amazon Linux system. You are now ready to use Gradle for building and managing your Java projects efficiently. By leveraging Gradle’s powerful features, you can streamline your development workflow and improve productivity.


The Importance of Open Source Software

Open source software plays a crucial role in the tech industry by fostering collaboration, innovation, and accessibility. It empowers developers to build upon existing tools, contribute to projects, and create solutions that benefit the community as a whole. By supporting and utilizing open source software like Gradle, we can drive progress, share knowledge, and make technology more inclusive and sustainable.