In the same spirit than @Vegard (lightweight):
Put this jdk
bash function and a default in your .profile
jdk() {
version=$1
export JAVA_HOME=$(/usr/libexec/java_home -v"$version");
java -version
}
export JAVA_HOME=$(/usr/libexec/java_home -v11); # Your default version
and then, to switch your jdk, you can do
jdk 9
jdk 11
jdk 13