阿里云linux下安装maven
maven依赖JDK,所以要提前安装JDK1. 安装jdk
# cd /usr/local/
# wget http://download.oracle.com/otn-pub/java/jdk/7u45-b18/jdk-7u45-linux-x64.tar.gz
# tar -xzvf jdk-7u45-linux-x64.tar.gz
# mv jdk-7u45-linux-x64 /usr/local/java
2. 安装maven
# wget http://apache.fayea.com/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz
# tar -xzvf apache-maven-3.3.9-bin.tar.gz
# mv apache-maven-3.3.9-bin /usr/local/maven-3.3.9
3. 环境变量配置
如下内容加入/etc/profile
export JAVA_HOME=/usr/local/java/
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$PATH:$JAVA_HOME/bin
export MAVEN_HOME=/usr/local/maven-3.1.1
export PATH=${PATH}:${MAVEN_HOME}/bin编辑完成后 # source /etc/profile
4. 分别测试
# java -version
# mvn -v
页:
[1]