setting JAVA_HOME in Snow Leopard

I had to google this myself but am posting here in case the few people reading this blog might use it.

One interesting thing I didn't realize is that Apple includes a bunch of the older JDKs for backwards compatibility I guess.

me@mylaptop$ ls /System/Library/Frameworks/JavaVM.framework/Versions/ 1.3/ 1.4/ 1.5/ 1.6/ A/ CurrentJDK/ 1.3.1/ 1.4.2/ 1.5.0/ 1.6.0/ Current/
And here is how you set your $JAVA_HOME environment variable in BASH.

me@mylaptop$ export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home/

And here is how you do that in t/csh shell

[me@mylaptop:~] msnow% setenv JAVA_HOME /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home [me@mylaptop:~] msnow% echo $JAVA_HOME /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home