Linux – Unable to download Oracle JDK 8 using Wget command


I have been trying to download "jdk-8u211-linux-x64.tar.gz" from with the below command. The file gets downloads but not the correct one. As when I do file jdk-8u221-linux-i586.tar.gz it is showing as html file.

command: wget --user=*** --password=******* --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" ""

And when I try to unzip it using tar -xvzf jdk-8u221-linux-i586.tar.gz I get below error:

gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable: exiting now

Best Answer

Following a licensing change of Oracle Java on 16 April 2019, Oracle now forbids anyone from downloading Java outside of their approved process.

That process is currently to log in to an Oracle account, accept the new license, then attempt the download with the authentication cookies in place.

WebUpd8 had to shut down their Oracle Java PPA for this exact reason.

If you have the right cookies, you can technically set them in your wget headers, but you would have to browse to the download in your web browser and then copy the request that the browser is making. At that point, you might as well download Java with your browser.

There are no known workarounds at this time.

Related Question