ksnowlv

回顾过去,总结以往;立足现在,铭记当下;技术为主,笔记而已.

Mac安装Maven

| Comments

一.下载apache-maven-3.6.3见:Maven官网

apache-maven-3.6.3放置到/Users/用户名/目录下

二.配置环境变量

打开.bash_profile文件,配置如下:

export MAVENDIR=/Users/ksnowlv/apache-maven-3.6.3
export PATH=$PATH:$MAVENDIR/bin:$PATH

使用source ~/.bash_profile命令使环境变量生效

三.测试是否安装成功

使用mvn -v命名测试

1.若成功输出如下内容
ksnowlvdeMacBook-Pro:QUICTest ksnowlv$ mvn -version
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: /Users/ksnowlv/apache-maven-3.6.3
Java version: 12, vendor: Oracle Corporation, runtime: /Library/Java/   JavaVirtualMachines/jdk-12.jdk/Contents/Home
Default locale: zh_CN_#Hans, platform encoding: UTF-8
OS name: "mac os x", version: "10.15", arch: "x86_64", family: "mac"
2.若失败,如下内容,更新下JAVA_HOME目录即可。
The JAVA_HOME environment variable is not defined correctly
This environment variable is needed to run this program
NB: JAVA_HOME should point to a JDK not a JRE

Comments

comments powered by Disqus
Included file 'custom/after_footer.html' not found in _includes directory