转载地址: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. mysql性能优化随笔

    mysql性能优化是一个很大的命题,这里只记录一下近期的一些小经验. 曾经以为看了点create table时加index的语法就觉得自己知道怎么做mysql优化了,后来又看了点介绍mysql索引底层 ...

  2. 使用 SQLContext 可以从现有的 RDD 或数据源创建 DataFrames 报错?

    报错情况: 解决方法: SQLContext可能需要自己创建. 所以,先运行var sqlContext=new org.apache.spark.sql SQLContext(sc).即可. 之后再 ...

  3. idea中使用python环境

    idea中使用python环境,需要下载相关的python sdk 可以添加选择自己的python环境

  4. Kettle Unable to get list of element types for namespace 'pentaho'

    我把公司的kettle5.0升级到7.0之后遇到了这个问题,困扰了很久,百度谷歌都查不到结果,所以只能自己查找原因. 由于已经被搞好了,现在无法截图了,总之就是下面这行报错,遇到这个错误的同学估计也不 ...

  5. 求数组前K个大的数

    我们举例,假若从10000万个数里选出前100个最大的数据. 首先我们先分析:既然要选出前100个最大的数据,我们就建立一个大小为100的堆(建堆时就按找最大堆的规则建立,即每一个根节点都大于它的子女 ...

  6. 误删除/boot ,如何修复

    进入救援模式 1.chroot /mnt/sysimage  将路径修改为 /mnt/sysimage 2.mkdir /mnt/temp mount /dev/sr0 /mnt/temp 挂载光盘 ...

  7. 【51Nod 1769】Clarke and math2

    [51Nod 1769]Clarke and math2 题面 51Nod 题解 对于一个数论函数\(f\),\(\sum_{d|n}f(d)=(f\times 1)(n)\). 其实题目就是要求\( ...

  8. CF1163E Magical Permutation(线性基,构造)

    虽然做起来有一点裸……但是就是想不到啊…… 首先令 $d_i=p_i\oplus p_{i-1}$,那么 $d_i$ 都是 $S$ 中的数,$a_i=d_i\oplus d_{i-1}\oplus \ ...

  9. CSP2019蒸馏记

    Day -\(\infty\) ~ Day -2 认真准备联赛. Day -1 复习模板,全真模拟比赛平衡树 下午进行了湖南大学 2 小时游. Day 0 上午睡过头了 下午日常训练,并没有什么开放日 ...

  10. C# HTTP系列11 以普通文件流方式上传文件远程服务器

    系列目录     [已更新最新开发文章,点击查看详细] 应用程序中上传附件是最常使用的操作之一,ASP.NET客户端一般通过上传控件实现, <input type="file" ...