Run java bundled in .app from command-line

To switch to another JVM, try to modify the JAVA_HOME and PATH shell environment variable in ~/.profile.

# in ~/.profile
# switch to another JVM (here, 1.7)
unset JAVA_HOME PATH
export JAVA_HOME="$(/usr/libexec/java_home -F --version 1.7 2>/dev/null)"
export PATH="${JAVA_HOME}/bin:${PATH}"

# general info on Java preferences
open -a 'Java Preferences'

Or open the .app file and edit or add the JVMVersionvalue in the Info.plist like so

<key>JVMVersion</key>
<string>1.6+</string>