Skip to content

Instantly share code, notes, and snippets.

Last active March 16, 2023 11:28
Star You must be signed in to star a gist
What would you like to do?
wget command to install Oracle JAVA JDK from stupid oracle website for centos and ubuntu
# rpm
wget --no-cookies \
--no-check-certificate \
--header "Cookie: oraclelicense=accept-securebackup-cookie" \
"" \
-O jdk-7-linux-x64.rpm
# ubuntu
wget --no-cookies \
--no-check-certificate \
--header "Cookie: oraclelicense=accept-securebackup-cookie" \
"" \
-O jdk-7-linux-x64.tar.gz
# then
tar -xzvf jdk-7-linux-x64.tar.gz
Copy link

grayaii commented Jun 14, 2018

Nonething seems to work. The best solution is to manually download the file, save it to s3 or some secure location that you have access to, and then have your install scripts install it from there. Oracle seems to change its download link on a whim.

Copy link

Latest, 1.7.2
wget --no-cookies --no-check-certificate \
--header "Cookie: oraclelicense=accept-securebackup-cookie"

Copy link

pmiklos commented Jul 30, 2018

It doesn't seem to work anymore unfortunately. It gives 401 Authorization Required

Copy link

ajardan commented Jul 30, 2018

It just looks like Oracle is aggressively removing old versions of Java from now on. Only latest 8u181 is available for download.

Here is the command:

wget --header "Cookie: oraclelicense=accept-securebackup-cookie"

Copy link

its very usefull thankyou soo much..

Copy link

i tried this for but i still keep getting 401 Authorization Required

wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie"

Copy link

Thanks so much!!
still works for jre-8u192-linux-x64.tar.gz with edited script:
$ wget --no-cookies --no-check-certificate --header "Cookie: oraclelicense=accept-securebackup-cookie" \

-O jre-8-linux.tar.gz

Copy link

rehrumesh commented Jan 29, 2019

Doesn't work with JDK 11

Copy link

yes it is not work for jdk8u202

Copy link

ezst036 commented Apr 19, 2019

wget command requires username and password authentication now for this to work.

Copy link

I confirm your point ezst036, I can't download it anymore from a curl or wget since the april 16th and the license update.
So now, I use a private S3

Copy link

Something goes wrong with,
You get System error. Please re-try your action. If you continue to get this error, please contact the Administrator.

Copy link

it doesnot work now. i tried below command, gives: 401 Authorization Required Username/Password Authentication Failed.

wget --no-cookies --no-check-certificate --header "Cookie: oraclelicense=accept-securebackup-cookie" "" -O jdk-8u211-linux-x64.tar.gz

any command to sign in oracle account- accept the license agreement - download the jdk tar.gz from cli?
the reason is becoz;

The Oracle JDK License has changed for releases starting April 16, 2019.
The new Oracle Technology Network License Agreement for Oracle Java SE is substantially different from prior Oracle JDK licenses. The new license permits certain uses, such as personal use and development use, at no cost -- but other uses authorized under prior Oracle JDK licenses may no longer be available. Please review the terms carefully before downloading and using this product. An FAQ is available here.

Oracle Java downloads now require logging in to an Oracle account to download Java updates, like the latest Oracle Java 8u211 / Java SE 8u212. Because of this I cannot update the PPA with the latest Java (and the old links were broken by Oracle).

For this reason, THIS PPA IS DISCONTINUED (unless I find some way around this limitation).

Oracle Java 8 is now stable. Below you'll find instructions on how to install it in Ubuntu / Linux Mint via a PPA repository. The PPA supports JDK8 for both 32bit and 64bit as well as ARM (ARM v6/v7 Hard Float ABI - there's no JDK 8 ARM Soft Float ABI archive available for download on Oracle's website).
please help!

Copy link

This worked for me, for getting 8u131 version, which I needed: wget -c --header "Cookie: oraclelicense=accept-securebackup-cookie"

I got this from, which lists commands for various versions.

Copy link

tried the above and doesnt work anymore
wget -c --header "Cookie: oraclelicense=accept-securebackup-cookie"

We are getting the below error
"HTTP request sent, awaiting response... 401 Authorization Required"

Copy link

jmdsg commented Aug 31, 2019

None of the above commands seems to work anymore.

I was able to download it with the following:

wget \
--continue \
--no-check-certificate \
-O jdk-11.0.4_linux-x64_bin.rpm \
--header "Cookie: oraclelicense=a" \

Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment