linux ---maven的安装和配置
linux下的maven的安装和配置:
本人使用的是apache-maven-3.3.9-bin.tar.gz------安装maven的前提是JDK安装成功:java -version 测试一下--JDK的安装参考本人的文章《JDK的安装与配置》:http://www.cnblogs.com/shilin000/p/5244339.html
1.将安装包放在/usr/local下
2.解压tar -xvf apache-maven-3.3.9-bin.tar.gz
3.设置环境变量:vi /etc/profile:添加
export JAVA_HOME=/usr/local/java/jdk1.7.0_67 export M2_HOME=/usr/local/apache-maven-3.3.9 export PATH=$PATH:$JAVA_HOME/bin:$M2_HOME/bin export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JAVA_HOME/jre/lib/rt.jar
4. source /etc/profile 生效
5. 测试一下安装是否成功:mvn -v,出现如下说明安装成功:
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T08:41:47-08:00) Maven home: /usr/local/apache-maven-3.3.9 Java version: 1.7.0_67, vendor: Oracle Corporation Java home: /usr/local/java/jdk1.7.0_67/jre Default locale: en_US, platform encoding: UTF-8 OS name: "linux", version: "2.6.32-573.el6.x86_64", arch: "amd64", family: "unix"