change default 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 java version command line debian

sudo update-alternatives --config java

Example 3: change java version

/usr/libexec/java_home -V  
export JAVA_HOME=`/usr/libexec/java_home -v 1.6.0_65-b14-462` //java 8

Example 4: linux change java

sudo update-java-alternatives -s java-8-oracle
export JAVA_HOME=/usr/lib/jvm/java-8-oracle/
export PATH=$PATH:$JAVA_HOME
123