我已经安装了从甲骨文网站下载的JDK7u7.但是在安装之后,终端仍然显示java版本6.
$java -version
java version "1.6.0_35"
Java(TM) SE Runtime Environment (build 1.6.0_35-b10-428-11M3811)
Java HotSpot(TM) 64-Bit Server VM (build 20.10-b01-428, mixed mode)
知道为什么java 7没有出现吗?
Ans: OK, the problem has been resolved. Here is the answer: I found that my Terminal has a .bash_profile and the java home variable is set to 1.6个
export JAVA_HOME="/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home"
这就是每次我打开新的终端窗口时导致问题的那条线.