Setting JAVA_HOME on Mac OS X

Some time ago I had set JAVA_HOME in my .profile on Mac OS X to the following:

JAVA_HOME=/Library/Java/Home; export JAVA_HOME

To some extent this works, but it doesn’t apparently pick up your preferred JDK version that you can set via the Java Preferences app in /Applications/Utilities (you set your preferred version by dragging your choice to the top of the list).

To set JAVA_HOME to be set to your preferred version, use this instead:

JAVA_HOME=`/usr/libexec/java_home`; export JAVA_HOME

This post here talks about the first approach, but there’s a comment in response to the post that points out the second point.

TrueCrypt with NTFS volumes on Mac OS X Lion

At some point I created a backup file on Windows 7 in a TrueCrypt volume container that was formatted with NTFS. I’m not sure why I originally formatted it with NTFS, but I think it was something to do with long filenames or a very deep directory nesting. Whatever. The point is, after upgrading to Lion, TrueCrypt would no longer mount this volume.

I did this several months ago, so I can’t remember what I originally did to get this setup, but apparently there’s something called MacFuse that adds support for additional filesystems, like NTFS on Mac. The version that I originally installed no longer works on Lion, so you need a different version that does – there’s a post here with a link to a version that works.

To get it working again, I uninstalled MacFuse and TrueCrypt, installed the version of MacFuse from above, reinstalled TrueCrypt, and not everything works.

Installing Java on OS X Lion

I’m sure there’s plenty of posts about this already, but I just upgraded to Mac OS X Lion today and it seems Java is not preinstalled. When you first attempt to launch a Java app though, Software Update launches and downloads a Java 6 JVM for you. Very nice.