2

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?
2

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 Preferences.app

enter image description here

For eclipse, I could add one line in /Applications/eclipse/Eclipse.app/Contents/MacOS/eclipse.ini to teach eclipse what Java it will use :

-vm
/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/bin/java
  • 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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .