Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

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 downloaded and installed Java 1.7 from this site.

When I run the Java Control Panel, I could check I have it correctly installed.

enter image description here

However, when I checked the Java version from command line, the version that I use is Java 1.6.

java -version
java version "1.6.0_33"
Java(TM) SE Runtime Environment (build 1.6.0_33-b03-424-11M3720)
Java HotSpot(TM) 64-Bit Server VM (build 20.8-b03-424, mixed mode)

The system directory doesn't have the 1.7.

enter image description here

What's wrong with this?

  • Where is the Java 1.7 is installed?
  • How can I make the Java 1.7 as default Java?
share|improve this question
up vote 1 down vote accepted

I found Java 1.7 SDK in /Library/Java/JavaVirtualMachines/jdk1.7.0_07.jdk, and all the binaries in /Library/Java/JavaVirtualMachines/jdk1.7.0_07.jdk/Contents/Home/bin.

enter image description here

And by clicking the jdk file, I could arrange the order so that Java SE 7 is executed first.

java -version
java version "1.7.0_07"
Java(TM) SE Runtime Environment (build 1.7.0_07-b10)
Java HotSpot(TM) 64-Bit Server VM (build 23.3-b01, mixed mode)

And I could also bring up the app from /Applications/Utilities/Java

enter image description here

For eclipse, I could add one line in /Applications/eclipse/ to teach eclipse what Java it will use :

share|improve this answer
You really didn't give anyone much time to provide an answer eh? Good to know though – Stu Wilson Sep 12 '12 at 6:08
This answer is great if you have the JDK installed. But what if you only have the JRE installed? Nothing shows up in /Library/Java/JavaVirtualMachines. – james.garriss Apr 24 '13 at 1:08

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.