I’ve been using a bit of Java lately, and the OSX 1.6 JVM seemed pretty stable.
JRuby is the next thing on my geek list, and that runs best on Java 6.
Although the 1.6 JDK was installed in the last system update, it’s not the default:
hypnotoad:Desktop $ /usr/bin/java -version
java version "1.5.0_13"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_13-b05-237)
Java HotSpot(TM) Client VM (build 1.5.0_13-119, mixed mode, sharing)
hypnotoad:Desktop $
hypnotoad:~ $ ls -l `which java`
lrwxr-xr-x 1 root wheel 74 30 Apr 10:07 /usr/bin/java -> /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java
hypnotoad:~ $ cd /System/Library/Frameworks/JavaVM.framework/Versions/
hypnotoad:Versions $ ls -ld Current*
lrwxr-xr-x 1 root wheel 1 30 Apr 10:08 Current -> A
lrwxr-xr-x 1 root wheel 3 30 Apr 10:07 CurrentJDK -> 1.5
I know what you’re thinking. Don’t. Re-pointing those symlinks seems to work, but in fact it breaks all your GUI apps (the ‘A’ is for AWT)::
hypnotoad:Versions $ jconsole
2008-05-20 23:26:20.524 jconsole[680:10b] Apple AWT Startup Exception : ** -[NSCFArray insertObject:atIndex:]: attempt to insert nil
2008-05-20 23:26:20.525 jconsole[680:10b] Apple AWT Restarting Native Event Thread
Instead, you want to open /Applications/Utilities/Java/Java Preferences.App :
hypnotoad:~ $ java -version
java version "1.6.0_05"
Java(TM) SE Runtime Environment (build 1.6.0_05-b13-120)
Java HotSpot(TM) 64-Bit Server VM (build 1.6.0_05-b13-52, mixed mode)
hypnotoad:~ $
( ignore the text about ‘when an applet is executed in this browser’ – Intel Safari is 32-bit, and if you’re on PPC you don’t get JAVA 6 anyway ).
That Steve Jobs has a great sense of humour.



Thanks for the walkthrough. I was wondering how it was done without manually jigging the symlinks. It’s always easy when you know how!
September 4, 2008 @ 7:46 pm
Thanks for posting this. I was a few seconds away from changing the symlinks.
January 7, 2009 @ 11:26 pm
Thanks for the tip! This is far better than changing the symlinks…I did that and crashed my eclipse.
March 5, 2009 @ 6:04 pm
Java Preferences.app crashes when I try to open it. What system file / setting does it modify so that I can change it manually?
March 25, 2009 @ 2:56 pm
I just ran it under Instruments (File Activity -> Launch Executable) , and it seems to edit:
~/Library/Caches/Java/deployment.propertiesI’d try removing that file if I was you, it should be recreated.
March 25, 2009 @ 3:29 pm
Hi, I was able to get it to work also using this method. But for some reason when I run the java -version command as the root or using sudo, it still gives me java 1.5. The strange thing is that I am executing the same file! I track it down to the physical location and its pointing to the …\A\commands\java
June 2, 2009 @ 8:57 pm
@jamescway I think what Java version to run is set in your home directory. sudo runs java as root so that may be why.
June 8, 2009 @ 2:24 pm
@Dick My solution for getting the root user to work with the correct java was to run the Java Preferences.app as the root user. You can find a few more details at http://www.bangheadonwall.net/?p=118
June 11, 2009 @ 6:19 pm