How can I switch between the two Java versions in Mountain Lion now that Java Preferences is gone?
Open up a terminal use this command:

/usr/libexec/java_home -v 1.6 


You can change the 1.6 to any version of java you want to use and the command will output the location of where that version of java resides. (i.e: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home) 

then you can set the JAVA_HOME like you normally would with the output of the previous command. i.e.:

export JAVA_HOME=/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home


So to simplify; something like this should work:

export JAVA_HOME=$(/usr/libexec/java_home -v 1.6)


remember to check the version with: 

java -version


Hope it helps.