I let OS X handle downloading and installing the latest JDK via System Preferences -> Software Update. Some Java software require that JAVA_HOME be explicitly set, so where should it point?
From various recommendations, this seems to be the cleanest:
OS X 10.4.9 uses the bash shell so add this line to your ~/.bash_profile file:
You can see that this is just a symbolic link to the latest installed JDK:
chris:~ degiere$ ls -l $JAVA_HOME
lrwxr-xr-x 1 root wheel 24 Apr 1 23:46 /Library/Java/Home/ -> Versions/CurrentJDK/Home
Whenever the JDK is updated, your JAVA_HOME will be updated.