sudo apt install default-jdk

Read more of this post