Downloading Java JDK on Linux via wget is shown license page instead

If you are trying to download the Java Development Kit (JDK) on Linux using wget and you are being shown the license page instead of the JDK download, it is likely because the download page has changed since the wget command was written.

To fix this, you can try using the curl command instead of wget to download the JDK. Here's an example of how you can use curl to download the JDK:

  1. Go to the Java SE Downloads page on the Oracle website:

    https://www.oracle.com/java/technologies/javase-downloads.html

  2. Click on the "JDK Download" button for the JDK version that you want to download.

  3. Accept the license agreement and click on the "Download" button for the Linux platform.

  4. Copy the download link for the JDK from the browser. It should be a URL that looks like this:

    https://download.oracle.com/otn-pub/java/jdk/11.0.4+12/5b13a193868b4bf28bcb45c792fce896/jdk-11.0.4_linux-x64_bin.tar.gz

  5. Use the curl command to download the JDK using the download link that you copied:

    curl -L -C - -b "oraclelicense=accept-securebackup-cookie" -O <download_link>

    Replace <download_link> with the actual download link that you copied in step 4.

This should download the JDK to your current directory.

I hope this helps! Let me know if you have any questions.