Search
The Way of the Software Engineer

Apple has a build of java 1.6 available through the Apple Developer Connection site. The build is pretty recent (1.6.0-dp-b88-34) and includes a complete JDK. The package can be installed through the normal GUI method, or by the installer command line utility: `sudo installer -pkg JavaSE6Release1.pkg -target “/” `. However, once this is installed it is not the current default java runtime or library classpath. If you start seeing errors like ‘package javax.script does not exist’, you’ll know that you’re still using the old classpath. The good news is that it’s simple to fix, if you know where to look. I googled on this for at least a day before I realized how stupidly this is.

Look in your /System/Library/Frameworks/JavaVM.framework/Versions directory and you’ll see all your installed version of java. Half of the files in here are simlinks to other directories, including the ones named ‘Current’ and ‘CurrentJDK’. `ls -l` will reveal that these are still pointing to the 1.5 directories. Just remove them and create new simlinks to the 1.6 directories and you’re all set.

`sudo rm Current; sudo ln -s 1.6 Current`

`sudo rm CurrentJDK; sudo ln -s 1.6 CurrentJDK`

And you’re all done!

Check your java version with `java -version` and you’ll see your fresh java installed and working. Note: Missing the javax.script package is a clear indication that you’re still running 1.5 because this package is only installed by default in 1.6 installations.

2 Responses to “Java 1.6 on OS X”

    [...] 1.6.0″ among other things. If you’re using a Mac, you can follow my instructions here [ http://www.codebudo.com/2007/09/21/java-16-on-os-x/ [...]

    I’ve been told that there may be issues with this install method and Eclipse 3.3. It’s not clear if it’s 3.3 itself or a combination of plug-ins, but there are reports of Eclipse not being able to start w/o reverting to the old JVM.

Something to say?

You must be logged in to post a comment.