MAC查找JDK的路径

在控制台中输入
/usr/libexec/java_home -V

即可以看见

Matching Java Virtual Machines (2):
9.0.4, x86_64: “Java SE 9.0.4” /Library/Java/JavaVirtualMachines/jdk-9.0.4.jdk/Contents/Home
1.8.0_91, x86_64: “Java SE 8” /Library/Java/JavaVirtualMachines/jdk1.8.0_91.jdk/Contents/Home

打赏