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.

Invaluable tips for restoring a Mac OS X Time Machine backup to a new drive

I recently replaced my hard drive in my 2008 MacBook Pro. After following the excellent step-by-step instructions here, I booted up from my install DVD formatted my new drive, selected the option to restore from backup and was shocked to not see my new drive as an available target drive. I can’t find the post where I found this invaluable tip, but apparently it’s a known issue with the install DVD and the ‘restore from backup’ feature that if you’ve just formatted a new drive, you need to press ‘back’ all the way back to the language display screen before going forward again to get to the restore option. Now you new drive appears as a target drive for the restore. Bizarre. Ok, well it works.

The great thing about Time Machine on the Mac is that it’s effortless to restore your whole machine from a backup. This was the first time I’d tried it to a new hard drive but it worked without any issues. Well, almost…

Not thinking, I booted my machine for the restore from my original Leopard DVD but I had upgraded my machine to Snow Leopard some time back. Restore completed without an issue, rebooted, got a kernel panic! WTF! That’s the first time I’d seen that on my Mac. Quick bit of Googling later, rebooted from the Snow Leopard DVD, redid the restore and now all is ok.