gradle command not found

In this troubleshooting guide we learn how to fix gradle command not found error message

Introduction

When you run more command in linux terminal / console, you get the following error message

gradle: command not found

or when using sudo you get the following error message

sudo: gradle: command not found

Solutions to gradle: command not found

How To Fix gradle: command not found in Ubuntu / Debian / Kali Linux / Raspbian

In Ubuntu gradle is provided by gradle package.

gradle is:

Gradle is a build tool with a focus on build automation and support for multi-language development. If you are building, testing, publishing, and deploying software on any platform, Gradle offers a flexible model that can support the entire development lifecycle from compiling and packaging code to publishing web sites. Gradle has been designed to support build automation across multiple languages and platforms including Java, Scala, Android, C/C++, and Groovy, and is closely integrated with development tools and continuous integration servers including Eclipse, IntelliJ, and Jenkins.

To fix this problem, we can install more using the command below.

sudo apt-get -y install gradle

This command might take some time to finish depending on your machine internet connection.

You can also use apt command to install gradle.

sudo apt -y install gradle

Or if you have aptitude installed you can use the following command.

sudo aptitude install gradle

Summary

In this tutorial we learn how to fix gradle command not found error in Ubuntu / Debian / Kali Linux or Raspbian distribution.