Show what jdks are installed:
/usr/libexec/java_home -V
Add the following to .bash_profile to pin a default java version to use.
export JAVA_HOME=`/usr/libexec/java_home -v 1.8`
Validate:
java -version
Show what jdks are installed:
/usr/libexec/java_home -V
Add the following to .bash_profile to pin a default java version to use.
export JAVA_HOME=`/usr/libexec/java_home -v 1.8`
Validate:
java -version