jdk安装
java默认安装在如下目录下(不同版本不同目录)/Library/Java/JavaVirtualMachines/jdk1.8.0_361.jdk/Contents/Home
环境变量配置
sudo chmod o+w /etc/profile
vi /etc/profile
加入下面内容
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_361.jdk/Contents/Home
CLASSPAHT=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
PATH=$JAVA_HOME/bin:$PATH:
export JAVA_HOME
export CLASSPATH
export PATH
保存退出后
source /etc/profile
echo $JAVA_HOME确认
maven install
tar -xvf apache-maven-3.9.6-src.tar.gz
export M2_HOME=/Users/jianghui/Prog/maven3.9
export PATH=$PATH:$M2_HOME/bin
for test:mvn -v
标签:profile,JAVA,jdk,编程,MAC,export,PATH,HOME,安装 From: https://www.cnblogs.com/jhjesse/p/17887070.html