The default installs are currently java 11
sudo apt install default-jre
sudo apt install default-jdk
Older java versions can also be installed
sudo apt install openjdk-8-jre-headless
sudo apt install openjdk-8-jdk-headless
java versions can be switched with
sudo update-alternatives --config java
https://www.digitalocean.com/community/tutorials/how-to-install-java-with-apt-on-ubuntu-20-04