There are more and more projects replacing maven with gradle. The following describes how to install and configure the gradle environment in the centos server environment. 1. 2.download the gradle-2.2.1-all.zip gradle-2.2.1-bin.zip file and decompress it in/usr. now there are more and more projects replacing maven with gradle. The following describes how to install and configure the gradle environment in the centos server environment.
1.
2.download the gradle-2.2.1-all.zip gradle-2.2.1-bin.zip file and decompress it in the/usr/local directory.
[Java]View plaincopy
- $ Cd/usr/local
- $ Sudo unzip ~ /Gradle-2.2.1-all.zip.
3. set the runtime environment
$ Sudo vi/etc/profile
Add the GRADLE_HOME output PATH to the file and modify the PATH settings as follows:
[Html]View plaincopy
- Export GRADLE_HOME =/usr/local/gradle-2.2.1
- Export PATH =$ {JAVA_HOME}/bin :$ {JRE_HOME}/bin :$ {GRADLE_HOME}/bin :$ {JAVA_HOME }:$ {PATH}
Append $ {GRADLE_HOME}/bin to the end of the PATH statement so that the system can find the PATH of the executable file.
If you do not want all users to use this configuration, you can configure the gradle environment for your account separately,
In the HOME directory of your account
$ Vi. bash_profile
Make a similar edit.
4. after saving and exiting, execute
$ Source/etc/profile
5. View gradle version information
[Html]View plaincopy
- $ Gradle-version
- ------------------------------------------------------------
- Gradle 2.2.1
- ------------------------------------------------------------
- Build time: 2014-11-24 09:45:35 UTC
- Build number: none
- Revision: 6fcb59c06f43a4e6b1bcb401f7686a8601a1fb4a
- Groovy: 2.3.6
- Ant: Apache Ant (TM) version v1.9.3 compiled on December 23 2013
- JVM: 1.8.0 _ 25 (Oracle Corporation 25.25-b02)
- OS: Linux 2.6.32-431.11.2.el6.i686 i386
6. after gradle is successfully installed, you can use commands such as gradle build.