1、查看JAVA_HOME
user@user ~ % echo $JAVA_HOME
//结果为空
2、参考苹果官方说明:Important Java Directories on Mac OS X
Java Home
Many Java applications need to know the location of a $JAVA_HOME directory. The $JAVA_HOME on Mac OS X should be found using the /usr/libexec/java_home command line tool on Mac OS X 10.5 or later. On older Mac OS X versions where the tool does not exist, use the fixed path “/Library/Java/Home”…省略下文。
user@user Home % /usr/libexec/java_home
//result:java_home真实路径