1.源码包
apache-maven-3.3.9-bin.tar.gz
2.解压
# tar -zxvf /mnt/data_10G/software/apache-maven-3.3.9-bin.tar.gz -C /usr/local/ # mv apache-maven-3.3.9 maven
3.配置环境变量
# vim /etc/profile
最后一段的配置如下
export JAVA_HOME=/usr/local/java/jdk1.7.0_79 export JRE_HOME=/usr/local/java/jdk1.7.0_79/jre export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib:$CLASSPATH export MAVEN_HOME=/usr/local/maven export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$MAVEN_HOME/bin:$PATH
让环境变量配置生效
# source /etc/profile
4.验证是否配置成功
# mvn –v
时间: 2024-10-31 15:18:56