Error: JAVA_HOME is not defined correctly.
We cannot execute
/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home/bin/java
我已经将OSX升级到10.8.4。在OSX升级后,我已经将我的JDK和JRE升级到了7。但是,当我尝试进行项目的Maven构建时,出现了以上错误。
当我跑步 ls -al /System/Library/Frameworks/JavaVM.framework/Versions/
我得到以下回应
drwxr-xr-x 11 root wheel 374 Jul 22 22:33 .
drwxr-xr-x 10 root wheel 340 Jul 22 18:30 ..
lrwxr-xr-x 1 root wheel 10 Jul 22 18:30 1.4 -> CurrentJDK
lrwxr-xr-x 1 root wheel 10 Jul 22 18:30 1.4.2 -> CurrentJDK
lrwxr-xr-x 1 root wheel 10 Jul 22 18:30 1.5 -> CurrentJDK
lrwxr-xr-x 1 root wheel 10 Jul 22 18:30 1.5.0 -> CurrentJDK
lrwxr-xr-x 1 root wheel 10 Jul 22 18:30 1.6 -> CurrentJDK
lrwxr-xr-x 1 root wheel 10 Jul 22 18:30 1.6.0 -> CurrentJDK
drwxr-xr-x 7 root wheel 238 Jul 22 18:30 A
lrwxr-xr-x 1 root wheel 1 Jul 22 18:30 Current -> A
lrwxr-xr-x 1 root wheel 59 Jul 22 18:30 CurrentJDK -> /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents
为了这 ls -al /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home/bin
我在CurrentJDK中看不到任何内容。
跑步时 /usr/libexec/java_home
我得到:
/Library/Java/JavaVirtualMachines/jdk1.7.0_25.jdk/Contents/Home
我对使用OS X非常陌生。请让我知道我是否仍然错过了使它成功的任何要点。
export JAVA_HOME=/usr/libexec/java_home
的.profile - > export PATH=${JAVA_HOME}/bin:$PATH
export CATALINA_HOME=/Library/Tomcat/Home
的.bashrc和.profile中中有提到的上述命令..
echo $JAVA_HOME
,ls -al /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home/bin
并将ls -al /System/Library/Frameworks/JavaVM.framework/Versions/
结果添加到问题中吗?