gradle to build and configure

download

Official Website: https://gradle.org/install/#manually

Provides two ways to download, Binary-only download the binary source code only, Complete, with docs and sources is to download the source code and documentation. If there is a demand to read the document can be downloaded a second, there is no need to download Binary-only.

Installation and Configuration

Extracting installation package to the directory you want to install to.

Configuration environment variable to the bin directory

Modify the location of the local repository Gradle

The C: \ Users \ youname \ .gradle default directory to d: /gradle_repo/.gradle, then set system environment variables:
GRADLE_USER_HOME = D: /gradle_repo/.gradle

gradle domestic accelerate, modify the source image

a). configuration is only effective on the current project

Modify / file in build.gradle add repositories configuration
repositories {
    maven {
        url "http://maven.aliyun.com/nexus/content/groups/public"
    }
}

b). Configuration takes effect globally.

Find (the user's home directory) /. Gradle / init.gradle file, if the file can not be found init.gradle, their new one 
modify / add repositories in the configuration file init.gradle
allprojects {
    repositories {
        maven {
            url "http://maven.aliyun.com/nexus/content/groups/public"
        }
    }
}

Verify that the amendment is successful

Add a task within build.gradle file

task showRepos {
    doLast {
        repositories.each {
            println "repository: ${it.name} ('${it.url}')"
        }
    }
}

Gradle -q showRepos then perform the task, if the output of the address just configured it shows modified successfully, as follows:

$ gradle -q showRepos
repository: maven ('http://maven.aliyun.com/nexus/content/groups/public')

Tools.jar error will be reported here can not be found, the solution:

tools.jar at the jdk lib.
Let me talk about the difference between the jdk and jre:
Jre is operating environment, and compiled java jre program runs only on the line;
jdk is the development environment, when you develop java applications require jdk.

Jdk includes jre, and the java program running jre or jdk can, but jdk includes the tools you need in the development process.

If you just run the java program, as long as the jre on the line, because jre jdk than save space. I generally will be in the D configuration java environment: \ jdk6 \ bin directory directly into the environment variable on it, which is java compiler environment has to meet the requirements.

But ant needed tools.jar
best to configure the environment variables: JAVA_HOME = C: \ Program Files \ the Java \ jdk1.6.0_10
. The CLASSPATH =;% JAVA_HOME% \ lib;% JAVA_HOME% \ lib \ Run so tools.jar it will not go wrong when ant compiler.

But in order to change the environment variables to bypass the question, I simply copy JDK folder tools.jar to the next jre \ lib

 

 

Guess you like

Origin www.cnblogs.com/lvchengda/p/12619807.html