Many java applications that use shell scripts to configure their environment use the JAVA_HOME environment variable to start the correct version of java, locate JRE jars, etc.
On OSX 10.6, the following paths seem to be valid for this variable
/Library/Java/Home
/System/Library/Frameworks/JavaVM.framework/Home
/System/Library/Frameworks/JavaVM.framework/Versions/Current
Some of these are symlinks to the actual current VM (as defined in the Java Preference pane), but which one should be used - or is it OK to use any of them?