Question: how to install java in ubuntu 16?
Answer: Install the “Main” repository with apt: sudo apt-get update.
Install OpenJDK 8: sudo apt-get install openjdk-8-jdk. ... 
Verify that Java and the Java compiler have been properly installed: java -version javac -version.