tags:

views:

485

answers:

3

How can I set Java 1.6 to be the default for my MacBook Pro Intel Core 2 Duo with OS X 10.5.8? I have installed the latest software update, and dragged the Java SE 6 64-bit choice to the top in the "Java Preferences" application (and even rebooted), but still, on the command line, java -version responds with:

java version "1.5.0_24"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_24-b02-357-9M3165)
Java HotSpot(TM) Client VM (build 1.5.0_24-149, mixed mode, sharing)

Any ideas?

+2  A: 

There are symbolic link in /System/Library/Frameworks/JavaVM.framework

They point to a specific version in the Versions sub folder.

I have had these links breaking on occasion.

AFAICT there is a Current link which points to the Current JRE and a CurrentJDK.

Verify if all the links are pointing somewhere logical. Aparently the Java configlet does something but the chains of links gets broken somewhere else.

Sorry I wish I could be of more help, but it is all rather mysterious to me. I have always been able to fix it, but it was not pretty.

Peter Tillemans
Thank you, that helped my understanding a great deal!
Eyvind
+1  A: 

Change it the easy way

Also here is a very handy tip to give you easy access to different versions: Java on Mac OS X

Rulmeq
Thanks - it actually worked! :)
Eyvind
Though remember to do as stated in the comments after following the description in the main text: sudo ln -s 1.6 CurrentJDK
Eyvind
+1  A: 

For temporal changes:

export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/
openCage