ubuntu14.04安装maven

阅读更多
1、下载maven
http://maven.apache.org/download.cgi

2、解压
sudo tar zxvf /home/jd/Downloads/apache-maven-3.2.2-bin.tar.gz -C /usr/local/java


3、配置环境变量
sudo vim /etc/profile

添加
export M2_HOME=/usr/local/java/apache-maven-3.2.2
export M2=$M2_HOME/bin
export PATH=$M2:$PATH

保存
source /etc/profile


4、测试
mvn -version


Apache Maven 3.2.2 (45f7c06d68e745d05611f7fd14efb6594181933e; 2014-06-17T21:51:42+08:00)
Maven home: /usr/local/java/apache-maven-3.2.2
Java version: 1.8.0_11, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-8-sun/jre
Default locale: zh_CN, platform encoding: UTF-8
OS name: "linux", version: "3.13.0-24-generic", arch: "i386", family: "unix"


你可能感兴趣的:(ubuntu,maven)