Ubuntu 安装maven

下载maven

http://maven.apache.org/download.cgi
解压
tar -xzvf apache-maven-3.0.5-bin.tar.gz

配置环境变量

sudo vim /etc/profile
添加
export M2_HOME=/home/weibo/apache-maven-3.0.5
export M2=$M2_HOME/bin
export PATH=$M2:$PATH
保存 
source profile

测试

mvn -version
 
 
rying@beijing:/etc$ mvn -version
Apache Maven 3.0.5 (r01de14724cdef164cd33c7c8c2fe155faf9602da; 2013-02-19 21:51:28+0800)
Maven home: /home/weibo/apache-maven-3.0.5
Java version: 1.6.0_37, vendor: Sun Microsystems Inc.
Java home: /home/weibo/jdk1.6.0_37/jre
Default locale: en_US, platform encoding: ANSI_X3.4-1968
OS name: "linux", version: "3.2.0-48-generic", arch: "amd64", family: "unix"


OK

你可能感兴趣的:(linux)