select java version code example
Example 1: set default java version
# on linux
sudo update-alternatives --config java
# then just input the number of the jdk you
# want to use as default and hit Enter
Example 2: change default java version mac
nano ~/.zshrc
export JAVA_HOME=$(/usr/libexec/java_home -v 1.8.0)