I was installing CruiseControl on my Mac the other day when I realized that I needed to have JAVA_HOME set. Running which java returned /usr/bin/java. This was a symbolic link to the file /System/Library/Frameworks/JavaVM.framework/Commands/java. Eventually I figured out that the path I was looking for was /System/Library/Frameworks/JavaVM.framework/Home.