手动安装gradle

  在学习andorid studio时发现编译超级无比的慢,网上有文说是因为gradle的原因,使用离线gradle可以大幅提高编译速度,准备尝试下看看如何。由于gradle的资料都是英文,而我又是英文盲,所以尝试翻译下安装过程并做个记录。
  原文如下:
  

Install manually

Step 1. Download the latest Gradle distribution

The current Gradle release is version 4.10.2, released on 19 Sep 2018. The distribution zip file comes in two flavors:

If in doubt, choose the binary-only version and browse docs and sources online.

Need to work with an older version? See the releases page.

Step 2. Unpack the distribution

Linux & MacOS users

Unzip the distribution zip file in the directory of your choosing, e.g.:

$ mkdir /opt/gradle
$ unzip -d /opt/gradle gradle-4.10.2-bin.zip
$ ls /opt/gradle/gradle-4.10.2
LICENSE  NOTICE  bin  getting-started.html  init.d  lib  media
Microsoft Windows users

Create a new directory C:\Gradle with File Explorer.

Open a second File Explorer window and go to the directory where the Gradle distribution was downloaded. Double-click the ZIP archive to expose the content. Drag the content folder gradle-4.10.2 to your newly created C:\Gradle folder.

Alternatively you can unpack the Gradle distribution ZIP into C:\Gradle using an archiver tool of your choice.

Step 3. Configure your system environment

Linux & MacOS users

Configure your PATH environment variable to include the bin directory of the unzipped distribution, e.g.:

 $ export PATH=$PATH:/opt/gradle/gradle-4.10.2/bin
Microsoft Windows users

In File Explorer right-click on the This PC (or Computer) icon, then click Properties -> Advanced System Settings -> Environmental Variables.

Under System Variables select Path, then click Edit. Add an entry for C:\Gradle\gradle-4.10.2\bin. Click OK to save.

Step 4. Verify your installation

Open a console (or a Windows command prompt) and run gradle -v to run gradle and display the version, e.g.:

$ gradle -v

------------------------------------------------------------
Gradle 4.10.2
------------------------------------------------------------

› Proceed to next steps

  中文安装过程:
  手动安装:
  1、下载最新的gradle安装包,gradle-4.10.2-bin.zip
  2、gradle当前最新版本是4.10.2,发布于2018年9月19日,有两种发布形式,一种是仅有编译过的可执行程序,一种是源代码和帮助文档,我们选择二进制模式
  3、解压下载的文件到C:\Gradle(别的文件夹应该也可以)
  4、设置系统环境变量,把C:\Gradle\gradle-4.10.2\bin路径添加到path里面
  5、检查安装是否成功,打开CMD,输入gradle -v看看是否成功

posted on 2018-11-01 11:43  孤山独剑  阅读(2693)  评论(0编辑  收藏  举报

导航