这个问题在这里已有答案:
我安装了jdk 1.8.0 u5,但命令行java报告的是1.7:
$ java -fullversion
java full version "1.7.0_51-b13"
$ which java
/usr/bin/java
$ ls -l /usr/bin/java
lrwxr-xr-x 1 root wheel 74 Oct 23 2013 /usr/bin/java -> /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java
这是安装的内容
$ ls -l /System/Library/Frameworks/JavaVM.framework/Versions/
total 64
lrwxr-xr-x 1 root wheel 10 Oct 23 2013 1.4 -> CurrentJDK
lrwxr-xr-x 1 root wheel 10 Oct 23 2013 1.4.2 -> CurrentJDK
lrwxr-xr-x 1 root wheel 10 Oct 23 2013 1.5 -> CurrentJDK
lrwxr-xr-x 1 root wheel 10 Oct 23 2013 1.5.0 -> CurrentJDK
lrwxr-xr-x 1 root wheel 10 Oct 23 2013 1.6 -> CurrentJDK
lrwxr-xr-x 1 root wheel 10 Oct 23 2013 1.6.0 -> CurrentJDK
drwxr-xr-x 8 root wheel 272 May 13 10:21 A
lrwxr-xr-x 1 root wheel 1 Oct 23 2013 Current -> A
lrwxr-xr-x 1 root wheel 59 Oct 23 2013 CurrentJDK -> /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents
也:
$ /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java -fullversion
java full version "1.7.0_51-b13"
java控制面板小程序报告1.8,但在/ Library / Internet \ Plug-Ins / JavaAppletPlugin.plugin /
知道去哪了吗?