mac mvn 编译 找不到JDK
所属分类 java
浏览量 911
/usr/libexec/java_home -V
Matching Java Virtual Machines (3):
1.8.321.07 (x86_64) "Oracle Corporation" - "Java" /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home
1.8.0_321 (x86_64) "Oracle Corporation" - "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_321.jdk/Contents/Home
1.8.0_221 (x86_64) "Oracle Corporation" - "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_221.jdk/Contents/Home
/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home
mvn clean install 报错
No compiler is provided in this environment. Perhaps you are running on a JRE rather than a
mvn -version
Apache Maven 3.8.4 (9b656c72d54e5bacbed989b64718c159fe39b537)
Maven home: /Users/dugang/dugang/soft/maven
Java version: 1.8.0_321, vendor: Oracle Corporation, runtime: /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home
Default locale: zh_CN, platform encoding: UTF-8
OS name: "mac os x", version: "12.0.1", arch: "x86_64", family: "mac"
指向的路径不对
/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home
export JAVA_HOME=/Library/java/JavaVirtualMachines/jdk1.8.0_321.jdk/Contents/Home
mvn -version
Apache Maven 3.8.4 (9b656c72d54e5bacbed989b64718c159fe39b537)
Maven home: /Users/dugang/dugang/soft/maven
Java version: 1.8.0_321, vendor: Oracle Corporation, runtime: /Library/Java/JavaVirtualMachines/jdk1.8.0_321.jdk/Contents/Home/jre
Default locale: zh_CN, platform encoding: UTF-8
OS name: "mac os x", version: "12.0.1", arch: "x86_64", family: "mac"
/Library/Java/JavaVirtualMachines/jdk1.8.0_321.jdk/Contents/Home/jre
路径ok 编译ok
mac切换jdk版本
上一篇
下一篇
Scala reduceLeft和reduceRight
scala Future和Promise
IDEA 远程调试
Scala map与flatMap
Scala 集合操作
play scala hello world tutorial