set java version linux code example
Example 1: how to change java version in linux
$ sudo update-alternatives --config java
Example 2: check java version linux
//1.6 and higher versions
java -version
Example 3: change java version command line debian
sudo update-alternatives --config java
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