Abra um terminal e inicie
sudo update-alternatives --config java
Selecione Java 7. Isso é tudo.
Exemplo
There are 5 choices for the alternative java (providing /usr/bin/java). Selection Path Priority Status ------------------------------------------------------------ 0 /usr/lib/jvm/java-9-oracle/bin/java 1095 auto mode 1 /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java 1071 manual mode 2 /usr/lib/jvm/java-7-oracle/jre/bin/java 1085 manual mode 3 /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java 1081 manual mode * 4 /usr/lib/jvm/java-8-oracle/jre/bin/java 1091 manual mode 5 /usr/lib/jvm/java-9-oracle/bin/java 1095 manual mode Press enter to keep the current choice[*], or type selection number:
Verifique com
java -version
e você deve ver algo loke isso
java version "1.7.0_79"
OpenJDK Runtime Environment (IcedTea 2.5.6) (7u79-2.5.6-0ubuntu1.15.04.1)
OpenJDK 64-Bit Server VM (build 24.79-b02, mixed mode)