Everyone loves bloated thing. :P I am a hipster.

Conventions

export JAVA_VERSION=9

Now range: 7, 8, 9, 10!

Install OpenJDK

sudo apt install openjdk-$JAVA_VERSION-jdk-headless

Remember, this is headless, means no GUI libs.