Gradle cannot update successfully from v6.5.1 to v7.0.0

Viewed 118

I am trying to update my local gradle(out of ide) from 6.5.1 to 7.0.0.

I try two commands from gradle website and network in cmd and path is the root of one of my project(there are gradlew.bat and gradlew files):

gradle wrapper --gradle-version=7.0 --distribution-type=all

gradlew wrapper --gradle-version=7.0 --distribution-type all

And, i try those commands to check the version

gradle -v
gradlew -v

The gradlew updates sucessfully. It prints version 7.0.0.

However, the version of gradle is still in v6.5.1.

How can I update it without download the v7.0.0 packet and cover the files in disk(I am worrying about that i should download all of my packages again in new gradle)?

ps: the gradle is locating in D:\gradle in my disk and java environment is openJDK 15

Thanks agains

2 Answers

I had the same problem and, in my case, the problem was a running gradle demon using the previous version. Check running demons with:

gradle --status 

Stop the demons with

gradle --stop

Also I restarted the console/terminal.

You cannot update your gradle standalone version without downloading it, and with gradle wrapper you cannot upgrade your gradle installation, it always works on your current project folder (command gradlew) only. To upgrade a standalone gradle installation (command gradle without the wrapper prefix w), you have to manually download the binaries, include the new bin directory in your PATH environment as described in the manual on the gradle homepage, or use a package manager like sdk man, chocolatey, brew etc.

If you are using the gradle wrapper gradlew for your builds, it works completely independent from your gradle installation.

Related