Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
wget to download Java 8
wget --continue --no-check-certificate -O jdk-8-linux-x64.tar.gz --header Cookie: oraclelicense=a http://download.oracle.com/otn-pub/java/jdk/8-b132/jdk-8-linux-x64.tar.gz
@wanghaifeng

This comment has been minimized.

Copy link

commented Aug 20, 2016

I did small fix on above script:

wget --no-cookies \
--no-check-certificate \
--header "Cookie: oraclelicense=accept-securebackup-cookie" \
http://download.oracle.com/otn-pub/java/jdk/8u151-b12/jdk-8u151-linux-x64.tar.gz \
-O jdk-8-linux-x64.tar.gz

@arafatmohammed

This comment has been minimized.

Copy link

commented Nov 2, 2016

Thanks a lot!

@kwhitehall

This comment has been minimized.

Copy link

commented Feb 23, 2017

Thanks @wanghaifeng!

@wanghaifeng

This comment has been minimized.

Copy link

commented Mar 27, 2018

wget --no-cookies
--no-check-certificate
--header "Cookie: oraclelicense=accept-securebackup-cookie"
http://download.oracle.com/otn-pub/java/jdk/8u161-b12/2f38c3b165be4555a1fa6e98c45e0808/jdk-8u161-linux-x64.tar.gz
-O jdk-8-linux-x64.tar.gz

replace "2f38c3b165be4555a1fa6e98c45e0808" with correct string from JDK download page if above script returns 404 error.

@vamorris

This comment has been minimized.

Copy link

commented Apr 13, 2018

Thanks!

@vwal

This comment has been minimized.

Copy link

commented Apr 21, 2018

The latest for 8u171:

wget --no-cookies \
--no-check-certificate \
--header "Cookie: oraclelicense=accept-securebackup-cookie" \
http://download.oracle.com/otn-pub/java/jdk/8u171-b11/512cd62ec5174c3487ac17c61aaa89e8/jdk-8u171-linux-x64.tar.gz \
-O jdk-8-linux-x64.tar.gz
@Cheema1

This comment has been minimized.

Copy link

commented Apr 21, 2018

404 error-when I try to run this command..

@dongmo

This comment has been minimized.

Copy link

commented May 2, 2018

Hello All

I've 404 error with this command....

@emilioyn

This comment has been minimized.

Copy link

commented May 10, 2018

My update to Oracle Java 10:

wget --no-cookies --no-check-certificate --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/10.0.1+10/fb4372174a714e6b8c52526dc134031e/jdk-10.0.1_linux-x64_bin.tar.gz

@caarlos0

This comment has been minimized.

Copy link

commented May 15, 2018

for 172:

wget \
	--no-cookies \
	--header "Cookie: oraclelicense=accept-securebackup-cookie" \
	http://download.oracle.com/otn-pub/java/jdk/8u172-b11/a58eab1ec242421181065cdc37240b08/jdk-8u172-linux-x64.tar.gz \
	-O jdk-8u172-linux-x64.tar.gz

also: dont need the no-check-certificate param.

@grantliu

This comment has been minimized.

Copy link

commented Sep 13, 2018

wget --continue --no-check-certificate -O jdk-8u181-linux-x64.rpm --header "Cookie: oraclelicense=a" http://download.oracle.com/otn-pub/java/jdk/8u181-b13/96a7b8442fe848ef90c96a2fad6ed6d1/jdk-8u181-linux-x64.rpm

@evereklili

This comment has been minimized.

Copy link

commented Sep 20, 2018

but I dont access this link and other link. I dont understand. Oracle web site errorr... I see this message all site:

 "

This site http://www.oracle.com/ is experiencing technical difficulty. We are aware of the issue and are working as quick as possible to correct the issue. We apologize for any inconvenience this may have caused. To speak with an Oracle sales representative: 1.800.ORACLE1.To contact Oracle Corporate Headquarters from anywhere in the world: 1.650.506.7000.To get technical support in the United States: 1.800.633.0738."
Plase explain this message...

@atarora

This comment has been minimized.

Copy link

commented Oct 2, 2018

wget --continue --no-check-certificate -O jdk-8u181-linux-x64.tar.gz --header "Cookie: oraclelicense=a" http://download.oracle.com/otn-pub/java/jdk/8u181-b13/96a7b8442fe848ef90c96a2fad6ed6d1/jdk-8u181-linux-x64.tar.gz

@mentha

This comment has been minimized.

Copy link

commented Oct 21, 2018

Why --no-check-certificate when Oracle had their certificates properly set up.
I suggests removing this option as using it makes you vulnerable to MITM attacks.

@lywhlao

This comment has been minimized.

Copy link

commented Nov 7, 2018

wget --continue --no-check-certificate -O jdk-8u191-linux-x64.tar.gz --header "Cookie: oraclelicense=a" http://download.oracle.com/otn-pub/java/jdk/8u191-b12/2787e4a523244c269598db4e85c51e0c/jdk-8u191-linux-x64.tar.gz

@dhani-ahp

This comment has been minimized.

Copy link

commented Jan 17, 2019

curl -L -b "oraclelicense=a" -O https://download.oracle.com/otn-pub/java/jdk/8u201-b09/42970487e3af4f5aa5bca3f542482c60/jdk-8u201-linux-x64.tar.gz
sudo mkdir /usr/local/oracle-java-8
sudo tar -zxf jdk-8u201-linux-x64.tar.gz -C /usr/local/oracle-java-8

sudo update-alternatives --install "/usr/bin/java" "java" "/usr/local/oracle-java-8/jdk1.8.0_201/bin/java" 1500
sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/local/oracle-java-8/jdk1.8.0_201/bin/javac" 1500
sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/local/oracle-java-8/jdk1.8.0_201/bin/javaws" 1500

@jodth07

This comment has been minimized.

Copy link

commented Jan 19, 2019

New udpates with wget

wget --continue --no-check-certificate -O jdk-8u191-linux-x64.tar.gz --header "Cookie: oraclelicense=a" https://download.oracle.com/otn-pub/java/jdk/8u201-b09/42970487e3af4f5aa5bca3f542482c60/jdk-8u201-linux-x64.tar.gz

tar -xvf jdk-8u191-linux-x64.tar.gz

@shivraj-h

This comment has been minimized.

Copy link

commented Jan 19, 2019

jodth07 Thanks this worked for me.

@giacomoarru

This comment has been minimized.

Copy link

commented Mar 14, 2019

Thank you. This worked for me.

@fire9

This comment has been minimized.

Copy link

commented Apr 1, 2019

wget --no-cookies
--no-check-certificate
--header "Cookie: oraclelicense=accept-securebackup-cookie"
https://download.oracle.com/otn-pub/java/jdk/8u201-b09/42970487e3af4f5aa5bca3f542482c60/jdk-8u201-linux-x64.tar.gz

@gMan1990

This comment has been minimized.

Copy link

commented Apr 17, 2019

@fire9 #gistcomment-2877216
404:Not Found

@Andrei-Stepanov

This comment has been minimized.

Copy link

commented Apr 17, 2019

@alexterman

This comment has been minimized.

Copy link

commented May 1, 2019

@shakeerahamed

This comment has been minimized.

Copy link

commented May 26, 2019

curl -L -C - -b "oraclelicense=accept-securebackup-cookie" -O 'http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.tar.gz'

Thanks buddy ! Saved my day

@jaswinder2018

This comment has been minimized.

Copy link

commented Jun 11, 2019

can anyone give the wget command for 8u151 or higher which works as of now the command for 131 is working but I need 151 or higher rpm file

@jshulk

This comment has been minimized.

Copy link

commented Jul 7, 2019

Where can i find the otn-pub download url for a particular release ?

@AbdullahAl-Hajjar

This comment has been minimized.

Copy link

commented Aug 2, 2019

@jaswinder2018

This comment has been minimized.

Copy link

commented Aug 2, 2019

@AbdullahAl-Hajjar

This comment has been minimized.

Copy link

commented Aug 2, 2019

@rlsai

This comment has been minimized.

Copy link

commented Aug 8, 2019

curl -L -C - -b "oraclelicense=accept-securebackup-cookie" -O 'https://download.oracle.com/otn/java/jdk/8u221-b11/230deb18db3e4014bb8e3e8324f81b43/jdk-8u221-linux-x64.rpm'

curl -L -C - -b "oraclelicense=accept-securebackup-cookie" -O 'https://download.oracle.com/otn/java/jdk/8u221-b11/230deb18db3e4014bb8e3e8324f81b43/jdk-8u221-linux-x64.tar.gz'

This didn't work for me. The downloaded file is in html format

@goofiva

This comment has been minimized.

Copy link

commented Sep 13, 2019

This is sort of unrelated but, a lot of the links above expired. You can install specific versions of the rpm like this... Below is for 201.

bash-4.2# yum --showduplicates list java-1.8.0-openjdk
Loaded plugins: ovl, priorities
Available Packages
...
java-1.8.0-openjdk.x86_64 1:1.8.0.201.b09-0.43.amzn1 amzn-updates
...

yum install java-1.8.0-openjdk-1:1.8.0.201.b09-0.43.amzn1.x86_64 -y
yum install java-1.8.0-openjdk-devel-1:1.8.0.201.b09-0.43.amzn1.x86_64 -y

@cjsxorud111

This comment has been minimized.

Copy link

commented Sep 14, 2019

Thanks!

@alexmatte

This comment has been minimized.

@anjia0532

This comment has been minimized.

Copy link

commented Sep 18, 2019

if u want to download jre 1.8 latest version

$ url=$(curl -s https://www.java.com/en/download/linux_manual.jsp | grep -E ".*x64.*javadl" | grep -v "RPM" | sed "s/.*href=\"//g;s/\".*//g" | head -n 1)
$ wget -c --content-disposition $url
$ old=$(ls -hat | grep jre | head -n1)
$ mv $old $(echo $old | awk -F"?" '{print $1}')

8u221 tar.gz

$ wget -c --content-disposition "https://javadl.oracle.com/webapps/download/AutoDL?BundleId=239835_230deb18db3e4014bb8e3e8324f81b43"
$ old=$(ls -hat | grep jre | head -n1)
$ mv $old $(echo $old | awk -F"?" '{print $1}')

my blog 044-wget下载jdk8u221

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.