您的 JAVA_HOME 指向 /usr/bin/java 文件,但它应指向您的JDK的根目录。例如对我来说这是:
JAVA_HOME
/usr/bin/java
? ~ echo $JAVA_HOME /Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home ? ~ ll $JAVA_HOME total 52064 -rw-rw-r-- 1 root wheel 3.2K Oct 1 09:00 COPYRIGHT -rw-rw-r-- 1 root wheel 40B Oct 1 09:01 LICENSE -rw-rw-r-- 1 root wheel 159B Oct 1 09:01 README.html -rwxrwxr-x 1 root wheel 108K Sep 22 22:49 THIRDPARTYLICENSEREADME-JAVAFX.txt -rw-rw-r-- 1 root wheel 173K Oct 1 09:01 THIRDPARTYLICENSEREADME.txt drwxrwxr-x 46 root wheel 1.5K Oct 1 09:04 bin drwxrwxr-x 9 root wheel 306B Oct 1 09:00 db drwxrwxr-x 9 root wheel 306B Oct 1 09:00 include -rwxrwxr-x 1 root wheel 4.9M Sep 22 22:49 javafx-src.zip drwxrwxr-x 10 root wheel 340B Oct 1 09:02 jre drwxrwxr-x 14 root wheel 476B Oct 1 09:02 lib drwxrwxr-x 5 root wheel 170B Oct 1 09:01 man -rw-rw-r-- 1 root wheel 529B Oct 1 09:01 release -rw-rw-r-- 1 root wheel 20M Oct 1 09:01 src.zip
因此,尝试设置JDK根目录的有效路径。我认为应该解决你的问题。