Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
1  
Have you changed the default version under Java Preferences? –  Karan Jan 16 '13 at 5:05

3 Answers 3

....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: http://docs.oracle.com/javase/7/docs/webnotes/install/mac/mac-jre.html#version

You can always see the version of Java being used for Java web plug-ins by going to javatester.org 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.

http://www.oracle.com/technetwork/java/javase/downloads/java-se-jdk-7-download-432154.html

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

 
discard

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.