To install the Oracle JDK on a Linus server is often a tricky proposition. For one, the download page requires to confirm a prompt and only unlocks the download link after this prompt has been confirmed (via a cookie, I think). This makes it difficult to download the binary in the first place!
Thankfully, MaxdSre has created the following handy script to download and extract the JDK:
If you run this script, you are presented with a prompt as follows:
Just select the version you require, and the script will download and install the Oracle JDK.
Finally, you might have existing JDK versions installed on your machine which are managed using alternatives. For reference how to point your ‘java’ command to the new installation, please see this article.