Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to install Java 7 on my Mac but after the install if I do a java -version I still see the old version... Can someone please help me out

share|improve this question
Have you changed the default version under Java Preferences? – Karan Jan 16 '13 at 5:05

....or you may modify Apple symlink (the one you call when you run java -version) :

Do a :

sudo ln -sf /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java /usr/bin/java

share|improve this answer

If you're asking about the Java 7 JRE. You may not realize that java --version reports the java version from Apple (which is usually 1.6.x). Apple stopped provided JRE updates and now point Mac users to Oracle to install Java 7.

To get which version of Java 7 is installed you need to run

/Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java -version

As noted by Oracle's page here:

You can always see the version of Java being used for Java web plug-ins by going to and seeing what version number it returns. If you're asking about the entire Java Development Kit (JDK), then you need to install the JDK to replace the older Mac components.

share|improve this answer

If you have the Java SDK (not just the JRE), then java_home will find it, and you can set your JAVA_HOME and your PATH.

export JAVA_HOME=$(/usr/libexec/java_home -v 1.7);PATH=${JAVA_HOME}/bin:${PATH}

You can make this selection permanent by editing ~/.profile

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.