Choosing the default Java to use
If your system has more than one version of Java, configure which one your system uses by entering the following command in a terminal window
update-alternatives --config java update-alternatives --config javac update-alternatives --config javaws
which java
update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.8.0/bin/java" 1 update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.8.0/bin/javac" 1 update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/jdk1.8.0/bin/javaws" 1