How do i install gradle on WINDOWS 10

2020-05-26 01:51发布

问题:

I tried some ways with the path thing but it didnt work because when i edit the path in System variables it opens up all the paths not like in tutorials where i should just put the ;%GRADLE_HOME%\bin at the end.

回答1:

Download Gradle and unzip it to where you want it installed.

Then in Windows Search, search for "System" and then select: System (Control Panel)

Click the Advanced system settings link.

Click Environment Variables

Then click New button under user variable and add GRADLE_HOME to variable name and path pointing to the root directory of unpacked files from the Gradle to variable value.

In System variable section select Path and then click the Edit button. In next window click New button and add path pointing to the bin directory of unpacked files from the Gradle.



回答2:

If you are window user then Scoop will be the best option to installs the tools you know and love. Scoop is simply a command line installer.

simply run this commandscoop install gradle

But first you need to install scoop using powershell command

iex (new-object net.webclient).downloadstring('https://get.scoop.sh')

Note: if you get an error you might need to change the execution policy (i.e. enable Powershell) with following command

Set-ExecutionPolicy RemoteSigned -scope CurrentUser


回答3:

Download Gradle and unzip it to where you want it installed. Then open your USER variables window for your user (similar to what you show) and create a GRADLE_HOME variable with a path pointing to the root directory of your downloaded Gradle distribution. Then add it to the PATH in your USER variables with something like:

%PATH%;%GRADLE_HOME%\bin

Notice that I have prepended the existing PATH variable onto the new one. You don't want to remove what's already there. Also, your image shows something else added to the path. You will want to add that on to the line above, something like:

%PATH%;%YOUR_OTHER_STUFF%;%GRADLE_HOME%\bin

So that it won't be lost either.

This is what I have done on Windows for years. Other options are to use something like http://sdkman.io/; however, that requires extra work on Windows since it's really meant for OSes with a real terminal.



回答4:

In case you're here and none of these answers "helped", try restarting the shell program. I just spent more than an hour and I just had to restart my console window to do the trick.



回答5:

choco install gradle in shell/cmd.
of course, you gotta install the chocolatey first from here

Chocolatey - the package manager for Windows.



标签: gradle