Pretty new to Java and also to Mac ... I want to make sure JAVA_HOME is set so in other programs I can use its path. So I did some Googling and here is what I got:
I
This is not resilient to new installs of the JDK. According to Apple: - you should not set it globally - you should use libexec
http://lists.apple.com/archives/java-dev/2011/May/msg00040.html
You might think that:
$ cat /etc/launchd.conf
setenv JAVA_HOME /usr/libexec/java_home
would work - but no, it sets it literally.
But, as I say, according to that Apple Engineer, you are not supposed to set it globally anyway. :(