$ sudo update-alternatives --config java
There are 2 choices for the alternative java (providing /usr/bin/java).
Selection Path Priority Status
* 0 /usr/lib/jvm/java-9-openjdk-amd64/bin/java 1500 auto mode
1 /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java 1500 manual mode
2 /usr/lib/jvm/java-9-openjdk-amd64/bin/java 1500 manual mode
You have to install the
openjdk-8-jre
:Next switch to the jre-8 version:
Add JAVA_HOME variable:
check java version:
Same procedure for Oracle java.