gradle linux下环境变量设置
gradle下载:http://downloads.gradle.org/distributions/gradle-1.9-all.zipjdk下载:http://download.oracle.com/otn-pub/java/jdk/7u45-b18/jdk-7u45-linux-x64.rpm?AuthParam=1386483506_d5485d16ec92a4e1b7c66f
·
gradle下载:http://downloads.gradle.org/distributions/gradle-1.9-all.zip
jdk下载:http://download.oracle.com/otn-pub/java/jdk/7u45-b18/jdk-7u45-linux-x64.rpm?AuthParam=1386483506_d5485d16ec92a4e1b7c66feef5afa300
gradle解压到/opt下;
#unzip gradle-1.9-all.zip
安装jdk;
#rpm -ivh jdk-7u45-linux-x64.rpm
修改profile文件,添加环境变量
#vim /etc/profile #在profile文件最后添加如下内容,保存
#gradle安装在/opt/gradle-1.9目录下。
GRADLE_HOME=/opt/gradle-1.9;export GRADLE_HOME
export PATH=$PATH:/opt/gradle-1.9/bin
#jdk安装在/usr/java/jdk1.7.0_45目录
export JAVA_HOME=/usr/java/jdk1.7.0_45
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=${JAVA_HOME}/bin:$PATH
然后加载一下,使修改生效。
#source /etc/profile
gradle就可以使用了,效果如下:
bogon:~ # gradle
:help
Welcome to Gradle 1.9.
To run a build, run gradle <task> ...
To see a list of available tasks, run gradle tasks
To see a list of command-line options, run gradle --help
BUILD SUCCESSFUL
Total time: 3.959 secs
bogon:~ #
gradle 简单使用
默认使用当前目录下的build.gradle文件,也可以使用指定文件
#pwd
/
#cat build.gradle
task hello << { println 'Hello world!' } task intro(dependsOn: hello) << { println "I'm Gradle" }
bogon:/ # gradle hello
:hello
Hello world!
BUILD SUCCESSFUL
Total time: 5.809 secs
如果文件名不是build.gradle
bogon:/ # mv build.gradle aaa.gradle
bogon:/ # gradle -b aaa.gradle hello
:hello
Hello world!
BUILD SUCCESSFUL
Total time: 5.722 secs
bogon:/ #
简单介绍到此。
jdk下载:http://download.oracle.com/otn-pub/java/jdk/7u45-b18/jdk-7u45-linux-x64.rpm?AuthParam=1386483506_d5485d16ec92a4e1b7c66feef5afa300
gradle解压到/opt下;
#unzip gradle-1.9-all.zip
安装jdk;
#rpm -ivh jdk-7u45-linux-x64.rpm
修改profile文件,添加环境变量
#vim /etc/profile #在profile文件最后添加如下内容,保存
#gradle安装在/opt/gradle-1.9目录下。
GRADLE_HOME=/opt/gradle-1.9;export GRADLE_HOME
export PATH=$PATH:/opt/gradle-1.9/bin
#jdk安装在/usr/java/jdk1.7.0_45目录
export JAVA_HOME=/usr/java/jdk1.7.0_45
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=${JAVA_HOME}/bin:$PATH
然后加载一下,使修改生效。
#source /etc/profile
gradle就可以使用了,效果如下:
bogon:~ # gradle
:help
Welcome to Gradle 1.9.
To run a build, run gradle <task> ...
To see a list of available tasks, run gradle tasks
To see a list of command-line options, run gradle --help
BUILD SUCCESSFUL
Total time: 3.959 secs
bogon:~ #
gradle 简单使用
默认使用当前目录下的build.gradle文件,也可以使用指定文件
#pwd
/
#cat build.gradle
task hello << { println 'Hello world!' } task intro(dependsOn: hello) << { println "I'm Gradle" }
bogon:/ # gradle hello
:hello
Hello world!
BUILD SUCCESSFUL
Total time: 5.809 secs
如果文件名不是build.gradle
bogon:/ # mv build.gradle aaa.gradle
bogon:/ # gradle -b aaa.gradle hello
:hello
Hello world!
BUILD SUCCESSFUL
Total time: 5.722 secs
bogon:/ #
简单介绍到此。
更多推荐
已为社区贡献1条内容
所有评论(0)