Posted By: Anonymous
I’ve installed JDK 7u7 downloaded from oracle’s website. But after installation, the terminal is still showing java version 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)
any idea why java 7 is not showing up?
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
So this is the line causing the problem every time I opened a new terminal window.
Simply remove this line will solve the problem. You still need to follow what @aleroot said, but if that doesn’t work for you, check the .bash_profile (or .bashrc) setting file to see if you’ve previously exported any java version.
Because you need to enter in Java Preferences pane and flag only the JVM 7 in this way :
To easily and quickly open the Java Preferences pane in Mac OS X you can simply call spotlight with ⌘+SPACE and type System Preferences it will show up in the last row of the window.