How to update Gradle

How to update Gradle

Last Updated on March 17, 2021

Using the Gradle wrapper means that a project can be fixed to a specific version of Gradle. If you want to update Gradle to a newer version though, follow the simple steps in this article.

What’s my current Gradle version?

Assuming your project is using the Gradle wrapper, which it most likely is, run ./gradlew --version:

$ ./gradlew --version

Gradle 6.4.1

Build time:   2020-05-15 19:43:40 UTC
Revision:     1a04183c502614b5c80e33d603074e0b4a2777c5

Kotlin:       1.3.71
Groovy:       2.5.10
Ant:          Apache Ant(TM) version 1.10.7 compiled on September 1 2019
JVM:          11.0.7 (AdoptOpenJDK 11.0.7+10)
OS:           Windows 10 10.0 amd64

Working on Windows? Just replace any time you see ./gradlew in this article with gradlew.bat e.g. gradlew.bat --version

What updated Gradle version can I use?

You can go to the Gradle releases page to find the latest version.

If you’re using Java just remember that what Java version you want to build your project with influences what Gradle version you should choose:

Highest supported Java versionGradle versions
15Not yet supported
146.3 – 6.5
136.0 – 6.2.2
115.0 – 5.6.4
104.7 – 4.10.3
94.2.1 – 4.6

How do I update my Gradle version?

Just run ./gradlew wrapper --gradle-version <gradle-version>:

$ ./gradlew wrapper --gradle-version 6.5

1 actionable task: 1 executed

You can double check this has worked by running ./gradlew --version again:

$ ./gradlew --version

Gradle 6.5

Build time:   2020-06-02 20:46:21 UTC
Revision:     a27f41e4ae5e8a41ab9b19f8dd6d86d7b384dad4

Kotlin:       1.3.72
Groovy:       2.5.11
Ant:          Apache Ant(TM) version 1.10.7 compiled on September 1 2019
JVM:          11.0.7 (AdoptOpenJDK 11.0.7+10)
OS:           Windows 10 10.0 amd64

Commit all the changed files into version control. If you’re using git then the list should look like this when you run git status:

$ git status
On branch master
Your branch is up to date with 'origin/master'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

        modified:   gradle/wrapper/gradle-wrapper.jar
        modified:   gradle/wrapper/
        modified:   gradlew
        modified:   gradlew.bat

That’s it! You’re all upgraded onto the new Gradle version. ✅

How does the version update actually work?

If you’re curious as to how that worked, read on.

Whenever you run anything using ./gradlew it executes a script in your project root directory. That script accesses a file located in gradle/wrapper which contains the version of Gradle you’re targeting:


Gradle uses the distributionUrl property to download the new version of Gradle and stores it in your user home directory in ~/.gradle/wrapper/dists. The gradle-wrapper.jar file is used to do the actual download of the distribution.

When you update your Gradle version using ./gradlew wrapper --gradle-version <gradle-version>, all these files get changed automatically.

For even more details about how the Gradle wrapper works, check out the article What is the Gradle wrapper and why should you use it?.


✅ if you prefer to learn in video format, check out the accompanying video on the Tom Gregory Tech YouTube channel.

Get going with Gradle course
Gradle icon

Want to learn more about Gradle?
Check out the full selection of Gradle tutorials.

How to update Gradle

3 thoughts on “How to update Gradle

    1. Hi Jorp. I’ve now included instructions for Windows. Just replace any time you see ./gradlew in this article with gradlew.bat e.g. gradlew.bat --version

      1. Note that the original *nix syntax will work even on Windows, if you use PowerShell instead of cmd.

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to top


Getting started with Gradle just got A LOT easier!

Get Going with Gradle is the fastest way to a working knowledge of Gradle.

✅ Work effectively in basic Gradle projects
✅ Know how to setup Java projects in Gradle
✅ Understand the Gradle fundamentals

And it's yours today for FREE!

Where shall I send your access details?

Please wait...

Thank you, check your e-mail inbox for all the details!