How to install and configure gradle ?


This tutorials explains step by step tutorial on how to install and setup on below environments

  • windows
  • Linux
  • Mac OS
Gradle install windows linux and unix

Gradle is a Java and Android project build automation tool.

More projects are adopting this tool during development now that Android Studio supports integrated with Gradle.

Gradle requires Java to be installed. It needs JDK version 8 at least.

First Check Java is installed or not using below command

B:\>java -version
java version "1.8.0_102"
Java(TM) SE Runtime Environment (build 1.8.0_102-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.102-b14, mixed mode)

You can also check install maven tutorial

Install Gradle tool on Linux machine

Unix has SDKMAN online tool to manage different versions of packages.

It provides SDK command to installs

On shell or bash terminal, Run the below command

$ sdk install gradle 7.1.1

7.1.1 is latest version, you can use different version

Configure environment variables like below

export PATH=$PATH:/tmp/gradle/gradle-7.1.1/bin

How to Setup gradle tool in Mac OS?

Gradle installation done with homebrew tool

It is simple and easy to do with below command

brew install gradle

How to install gradle in windows

  • First download latest gradle distribution file from gradle download

  • Unzip to local drive, d:\gradle

  • Create an environment variable in windows GRADLE_HOME=d:\gradle

  • Change or update PATH environment variable to add gradle home

PATH=%PATH%;%GRADLE_HOME%\bin
  • Open terminal and you can able to run gradle command.

How to check gradle is installed or not ?


B:>gradle -v

------------------------------------------------------------
Gradle 6.0.1
------------------------------------------------------------

Build time:   2019-11-18 20:25:01 UTC
Revision:     fad121066a68c4701acd362daf4287a7c309a0f5

Kotlin:       1.3.50
Groovy:       2.5.8
Ant:          Apache Ant(TM) version 1.10.7 compiled on September 1 2019
JVM:          1.8.0_102 (Oracle Corporation 25.102-b14)
OS:           Windows 10 10.0 amd64
THE BEST NEWSLETTER ANYWHERE
Join 6,000 subscribers and get a daily digest of full stack tutorials delivered to your inbox directly.No spam ever. Unsubscribe any time.

Similar Posts
Subscribe
You'll get a notification every time a post gets published here.