简体   繁体   中英

How to change the Gradle version?

I would like to change the Gradle version to 3.5.1 according to the project version received from git using this eclipse.

So I changed the editing path for the system environment variable, but if you enter 'gradle -v' in cmd, only 4.4 appears.

I looked for various solutions on the Internet, but it didn't work out.

How can I change the version?

And how can I erase the existing version 4.4 completely? I tried to erase it, but it kept popping up even if I deleted all the related files.

gradle -v :

图片

One of the easiest way to change the gradle version is using sdkman . Install the required version you want and change whenever you want. Then hit

  • sdk install gradle <versionId>
  • sdk use gradle <versionId>

To check the list of versions installed

  • sdk list gradle

First, you need to know where Gradle is installed on your device. You can type where gradle in your terminal and the path will pop up.

Then, after you deleted the old version, go to the download page to download version 3.5.1. After download, follow the instructions in Installing manually in the Gradle installation guide .

Make sure that the old version is not included in your environment variables. If so, remove the old version and add the new one.

You can check Windows path variable by typing echo %PATH% in CMD.

Using Gradle Wrapper

To quote the manual :

If your existing Gradle-based build uses the Gradle Wrapper, you can easily upgrade by running the wrapper task, specifying the desired Gradle version:

./gradlew wrapper --gradle-version=7.4.2 --distribution-type=bin

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM