文件名:apache-maven-3.0.2-bin.tar.gz (/home/sky/maven/)
1. 解压
sky@sky-laptop:~/maven$ tar -zvxf apache-maven-3.0.2-bin.tar.gz
解压后的文件夹:/home/sky/maven/apache-maven-3.0.2
2.设置环境变量
sky@sky-laptop:~$ sudo gedit .bashrc
在配置文件中添加:
#maven
export M2_HOME=/home/sky/maven/apache-maven-3.0.2
export PATH=$PATH:$M2_HOME/bin
3.测试(注销重新登录)
sky@sky-laptop:~$echo $M2_HOME
/home/sky/maven/apache-maven-3.0.2
sky@sky-laptop:~$ mvn -version
Apache Maven 3.0.2 (r1056850; 2011-01-09 08:58:10+0800)
Java version: 1.6.0_23, vendor: Sun Microsystems Inc.
Java home: /home/sky/java/jdk1.6.0_23/jre
Default locale: zh_CN, platform encoding: UTF-8
OS name: "linux", version: "2.6.32-27-generic", arch: "i386", family: "unix"