Question: how to install java on ubuntu server?
Answer: First, update the apt package index with: sudo apt update. Once the package index is updated install the default Java OpenJDK package with: sudo apt install default-jdk.