Skip to content

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 actual download, it is likely because Oracle's download portal requires explicit acceptance or has changed its URL structure.

To bypass this, you can manually obtain a direct download link from your browser and use it with curl or wget. Here's how:

  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 your browser's address bar or network tab. It should be a URL that looks like this:

    https://download.oracle.com/otn-pub/java/jdk/<version>/<build>/<filename>.tar.gz

    (Note: Oracle frequently updates their download portal and URL structures. Always verify the current link on the official page.)

  5. Use curl or wget to download the JDK using the link you copied:

    bash
    # Using curl
    curl -O <download_link>
    
    # Using wget
    wget <download_link>

    Replace <download_link> with the actual URL from step 4.

    (Note: The legacy oraclelicense=accept-securebackup-cookie header is no longer required for modern JDK versions when using a direct browser-copied link.)

This should download the JDK archive to your current directory.

For a license-free alternative that avoids Oracle's download portal entirely, consider using Eclipse Temurin (formerly AdoptOpenJDK), which provides prebuilt OpenJDK binaries compatible with most Oracle JDK use cases.

Do you find this helpful?

Dual-run preview — compare with live Symfony routes.