标签:
CentOS上安装Maven3
1. 先确认已经安装java环境: java –version
2. 下载最新版的Maven apache-maven-3.0.2-bin.tar.gz
3. 解压缩到 /usr/local/apache-maven-3.0.2, 然后创建链接:
ln -s apache-maven-3.0.2 maven
4. 在/etc/profile添加下面两行:
export M3_HOME=/usr/local/maven
export PATH=${M3_HOME}/bin:${PATH}
5. 执行下面命令,使环境参数起效:
source /etc/profile
6.查看mvn版本,看是否配置正确:
如果显示
Warning: JAVA_HOME environment variable is not set.
Apache Maven 3.0.2 (r1056850; 2011-01-09 08:58:10+0800)
Java version: 1.6.0_17, vendor: Sun Microsystems Inc.
Java home: /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "2.6.18-194.el5", arch: "i386", family: "unix"
就正确了centos5.8安装maven3
标签:
原文地址:http://my.oschina.net/yangting880815/blog/420463