转载地址:http://ask.android-studio.org/?/article/16

4.1. Prerequisites 前提条件
Gradle requires a Java JDK or JRE to be installed, version 6 or higher (to check, use java -version). Gradle ships with its own Groovy library, therefore Groovy does not need to be installed. Any existing Groovy installation is ignored by Gradle.
<翻译> Gradle需要安装1.6及以上版本的Java JDK或JRE(使用java -version来查看当前版本)。Gradle拥有自己的Groovy库,因此不需要另行安装Groovy。任何已安装的Groovy都会被Gradle给忽略。

Gradle uses whatever JDK it finds in your path. Alternatively, you can set the JAVA_HOME environment variable to point to the installation directory of the desired JDK.
<翻译> Gradle使用环境变量中设置的JDK。另外,你可以设置JAVA_HOME环境变量来只想你所需要使用的JDK。

4.2. Download 下载
You can download one of the Gradle distributions from the Gradle web site.
<翻译> 你可以在Gradle网站下载。

4.3. Unpacking 解包
The Gradle distribution comes packaged as a ZIP. The full distribution contains:
<翻译> Gradle打包成了Zip包。完整版包含以下内容:

The Gradle binaries. Gradle二进制文件
The user guide (HTML and PDF). 用户向导(HTML和PDF版)
The DSL reference guide. DSL引用向导
The API documentation (Javadoc and Groovydoc). API文档(Javadoc 和 Groovydoc)
Extensive samples, including the examples referenced in the user guide, along with some complete and more complex builds you can use as a starting point for your own build.
<翻译> 大量的示例

The binary sources. This is for reference only. If you want to build Gradle you need to download the source distribution or checkout the sources from the source repository. See the Gradle web site for details.
<翻译> 二进制源。

4.4. Environment variables 环境变量
For running Gradle, add GRADLE_HOME/bin to your PATH environment variable. Usually, this is sufficient to run Gradle.
<翻译> 为了运行Gradle,添加GRADLE_HOME/bin到你的PATH环境变量。通常,这就足以运行Gradle。

4.5. Running and testing your installation 运行并测试你的安装
You run Gradle via the gradle command. To check if Gradle is properly installed just type gradle -v. The output shows the Gradle version and also the local environment configuration (Groovy, JVM version, OS, etc.). The displayed Gradle version should match the distribution you have downloaded.
<翻译> 你可以通过gradle命令来运行Gradle。输入gradle -v检查Gradle是否安装正常。输出内容将显示Gradle版本和一些本地环境配置(Groovy,Java虚拟机版本,操作系统等等)。Gradle版本号应该和你下载的是匹配的。

4.6. JVM options Java虚拟机选项
JVM options for running Gradle can be set via environment variables. You can use either GRADLE_OPTS or JAVA_OPTS, or both. JAVA_OPTS is by convention an environment variable shared by many Java applications. A typical use case would be to set the HTTP proxy in JAVA_OPTS and the memory options in GRADLE_OPTS. Those variables can also be set at the beginning of the gradle or gradlew script.
<翻译> 运行Gradle的Java虚拟机选项可以有环境变量来设置。你可以使用GRADLE_OPTS,JAVA_OPTS或者同时使用。JAVA_OPTS是共享给许多Java应用程序的共享环境变量。一个典型的用例就是在JAVA_OPTS中设置HTTP代理,在GRADLE_OPTS中设置内存选项。这些变量也可以设置在gradle或gradlew脚本的开头。

Note that it's not currently possible to set JVM options for Gradle on the command line.
<翻译> 备注:现在不支持使用命令行为Gradle设置Java虚拟机选项。

原文地址:http://www.gradle.org/docs/cur ... .html
翻译者:wellchang
邮箱:2483808264@qq.com

如对翻译内容有异议,请在评论区提出或联系作者

【转载】Gradle学习 第四章:安装Gradle的更多相关文章

  1. 【转载】Gradle学习 第七章:Java快速入门

    转载地址:http://ask.android-studio.org/?/article/22 7.1. The Java plugin(Java插件) As we have seen, Gradle ...

  2. 【转载】Gradle学习 第三章:教程

    转载地址:http://ask.android-studio.org/?/article/15 3.1. Getting Started 入门The following tutorials intro ...

  3. 【转载】Gradle学习 第六章:构建脚本基础

    转载地址:http://ask.android-studio.org/?/article/11 6.1. Projects and tasks 项目和任务Everything in Gradle si ...

  4. 【转载】Gradle学习 第十一章:使用Gradle命令行

    转载地址:http://ask.android-studio.org/?/article/94 This chapter introduces the basics of the Gradle com ...

  5. 《gradle 用户指南中文版》第3章 安装 gradle

    macOS 下安装 gradle,只要可以安装sdk的系统,使用sdk来安装,那么安装方式基本是一样的. Gradle在所有主要操作系统上运行,只需要安装Java JDK或JRE版本7或更高版本.要检 ...

  6. Gradle学习总结——抓重点学Gradle

    前言 网上关于Gradle的教程很多,但很多都是以"面"切入- 通过大量讲解其用法及其API分类来阐述.但Gradle API使用技巧众多,API更是成千上百,臣妾记不住呀.个人深 ...

  7. Java基础知识二次学习--第四章 异常

    第四章 异常处理   时间:2017年4月26日11:16:39~2017年4月26日11:28:58 章节:04章_01节 04章_02节 视频长度:20:46+01:16 内容:异常的概念 心得: ...

  8. C#高级编程 (第六版) 学习 第四章:继承

    第四章 继承 1,继承的类型 实现继承: 一个类派生于一个基类型,拥有该基类型所有成员字段和函数. 接口继承 一个类型只继承了函数的签名,没有继承任何实现代码.   2,实现继承 class MyDe ...

  9. Python爬虫学习==>第四章:MySQL的安装

    学习目的: 掌握MySQL数据库的安装 正式步骤 Step1:安装数据库 百度MySQL,下载软件 端口设置 设置密码,我的密码123456 下一步 下一步 查看MySQL服务器是否启动 PS:未申明 ...

随机推荐

  1. 跟着 Alex 学python 1.安装

    声明 : 文档内容学习于 http://www.cnblogs.com/xiaozhiqi/ 参考文档: http://www.runoob.com/python/python-tutorial.ht ...

  2. Java8——jdk——java.time包

    public class TestLocalDateTime { //6.ZonedDate.ZonedTime.ZonedDateTime : 带时区的时间或日期 @Test public void ...

  3. How to display `top` results sorted by memory usage in real time?

    If you're using the top that comes with Ubuntu (top -v = procps-ng version 3.3.10), then you can use ...

  4. vector的基本操作

    vector怎么删除元素? #include<iostream> #include<vector> using namespace std; int main() { vect ...

  5. luoguP4213 【模板】杜教筛(Sum)杜教筛

    链接 luogu 思路 为了做hdu来学杜教筛. 杜教筛模板题. 卡常数,我加了register居然跑到不到800ms. 太深了. 代码 // luogu-judger-enable-o2 #incl ...

  6. [LeetCode] 363. Max Sum of Rectangle No Larger Than K 最大矩阵和不超过K

    Given a non-empty 2D matrix matrix and an integer k, find the max sum of a rectangle in the matrix s ...

  7. [LeetCode] 43. Multiply Strings 字符串相乘

    Given two non-negative integers num1 and num2represented as strings, return the product of num1 and  ...

  8. Npcap:Nmap项目里一个为Windows而生的嗅探库 Npcap: Nmap Project's packet sniffing library for Windows

    如果有人知道Npcap与libpcap对应的头文件列表,请告诉我,非常感谢 Introduction介绍 This Manual describes the programming interface ...

  9. 网络基础-------------给电脑设置IP

    ip 是每一台电脑进入互联网的一个必备钥匙,没有它就不能体会冲浪的乐趣,当我们使用电脑连接无线时我们就会被自动分配一个ip地址(DHCP),这样我们就可以凭借这个IPV4地址来进行冲浪了,但是自动分配 ...

  10. git bash 使用自带 curl 命令出现乱码解决方法

    前言 使用过 git  的小伙伴应该都不会陌生,git 自带一个终端 git bash      类似于 window 自带的 dos git 官网下载:https://git-scm.com/dow ...