In Ubuntu system you can have more than one Java version installed. To choose which one of them
should be default - runned by java command (/usr/bin/java) -
you can issue following command:
sudo update-alternatives --config java
After that you will be prompted with short menu to choose desired Java version.