3.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

//gradle需要安装jdk或者jre,版本在6以上

not need to be installed. Any existing Groovy installation is ignored by Gradle.

//gradle有自己的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.

3.2. Download

You can download one of the Gradle distributions from the Gradle web site.

3.3. Unpacking

The Gradle distribution comes packaged as a ZIP. The full distribution contains:

  • The Gradle binaries.

  • The user guide (HTML and PDF).

  • The DSL reference guide.

  • The API documentation (Javadoc and 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.

3.4. Environment variables

For running Gradle, firstly add the environment variable GRADLE_HOME. This should point to the unpacked files from the Gradle website. Next add GRADLE_HOME/bin to yourPATH environment variable. Usually, this is sufficient to run Gradle.

3.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

//使用gradle -v命令输出gradle版本内容来检查gradle是否正确安装

environment configuration (Groovy, JVM version, OS, etc.). The displayed Gradle version should match the distribution you have downloaded.

3.6. JVM options

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.

Note that it's not currently possible to set JVM options for Gradle on the command line.

Chapter 3. Installing Gradle 安装gradle的更多相关文章

  1. Gradle安装 Gradle效率提升 eclipse安装gradle插件 【我】

    Gradle安装 从官网下载 gradle4.6版本,也可以从svn地址下载 https://downloads.gradle.org/distributions/gradle-4.6-bin.zip ...

  2. Gradle笔记——Gradle的简介与安装

    本博客对Gradle进行一个简单的介绍,以及它的安装. Gradle介绍 Gradle是一个基于JVM的构建工具,它提供了: 像Ant一样,通用灵活的构建工具 可以切换的,基于约定的构建框架 强大的多 ...

  3. Gradle安装

    最近在学Android,而Android是由Gradle来构建的:Gradle是一个基于 JVM 的构建工具.所以开始学习Android之前,先进行Gradle安装与学习: mac: 使用SDKMAN ...

  4. Gradle用户指南(1)-Gradle安装

    前置条件 Gradle 需要 Java JDK 或者 JRE,版本是 6 及以上.Gradle 将会装载自己的 Groovy 库,因此,Groovy 不需要被安装.任何存在的 Groovy 安装都会被 ...

  5. ubuntu下安装gradle

    1.下载gradle 下载地址:当前版本gradle-2.10-all.zip http://gradle.org/gradle-download/ 2.解压安装gradle unzip gradle ...

  6. eclipse安装Gradle

    第一步:下载Gradle>http://gradle.org/gradle-download 第二步:解压gradle-2.5, 配置环境变量:GRADLE_HOME path添加;%GRADL ...

  7. Eclipse4JavaEE安装Gradle,并导入我们的Gradle项目

    第一步:下载Gradle Gradle下载链接,如下图,下载最新版本即可.下载下来的zip包,解压到一个目录即可,如F盘 第二步:配置环境变量 首先添加GRADLE_HOME,如下图 然后在Path下 ...

  8. mac下安装gradle

    安装 gradle brew install gradle 配置Path环境 vim .bash_profile // 写入 export PATH="${PATH}:/usr/local/ ...

  9. Linux安装Gradle

    Linux安装Gradle   Gradle 是以 Groovy 语言为基础,面向Java应用为主.基于DSL(领域特定语言)语法的自动化构建工具.在github上,gradle项目很多,有的是gra ...

随机推荐

  1. Android学习及如何利用android来赚钱

    一.如何学习Android      android开发(这里不提platform和底层驱动)你需要对Java有个良好的基础,一般我们用Eclipse作为开发工具.对于过多的具体知识详细介绍我这里不展 ...

  2. Android4.3 蓝牙BLE初步

    一.关键概念: Generic Attribute Profile (GATT) 通过BLE连接,读写属性类小数据的Profile通用规范.现在所有的BLE应用Profile都是基于GATT的.   ...

  3. 使用Qt实现简单的图片预览效果 good

    http://www.cnblogs.com/appsucc/archive/2012/02/28/2371506.html Qt之实现工具箱界面程序 http://www.cnblogs.com/a ...

  4. 【Xamarin开发 Android 系列 3】循序渐进的学习顺序

    原文:[Xamarin开发 Android 系列 3]循序渐进的学习顺序 指定合理的学习步骤,将各个技术点进行强化.慢慢 的就从点到线 到面的飞跃,一切仅仅是时间问题,开始前,请记住,学习是最佳的投资 ...

  5. jQuery zTree v3.5 实例3 异步树

    最终效果: 点击非叶子节点时,向后台发送请求,获取下级菜单 前台代码如下: <%@ page language="java" contentType="text/h ...

  6. bzoj1927

    看到这道题不难想到费用流吧,但是怎么做呢? 一开始看到“每个点都恰好走一次”,我首先想到的有下界最小费用流, 然后发现这没有满足最大流的条件,然后又连边松弛掉多余的流 为了按照可行流的做法先减减去极大 ...

  7. Method Overloading in WCF zt

    Method overloading is the process of implementing Polymorphism in Object-Oriented Programming. A met ...

  8. win8 mysqlzip install

    1. 下载MySQL Community Server 5.6.142. 解压MySQL压缩包 将以下载的MySQL压缩包解压到自定义目录下.3. 添加环境变量 变量名:MYSQL_HOME 变量值: ...

  9. ReentrantLock Condition 实现消费者生产者问题

    import java.util.LinkedList; import java.util.Queue; import java.util.concurrent.ExecutorService; im ...

  10. jQuery技术内幕预览版.pdf1

    第一章 总体构架 jQuery模块可以分为3部分:入口模块.底层支持模块和功能模块 浏览器功能测试模块提供了针对不同浏览器功能和bug的测试结果,其它模块基于测试结果解决浏览器之间的兼容性问题 回调函 ...