SetJDK is a project mainly written in ..., it's free.
script to switch OSX JDK from all installed JDK's