Apple made it incredibly difficult to switch JVMs since Mountain Lion. This might make it slightly easier.
-
Download
jvm.shto~/bin -
Create an alias for
jvm.shtojvmin~/.profileor~/.zshrcor whateveralias jvm="source ~/bin/jvm.sh"
-
Start a new shell.
-
To see current JVM and list JVMs
jvm
-
To unset JVM
jvm -u
-
To switch JVM
jvm /Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home