Friday, July 20, 2012

Download jdk using wget

 
http://www.oracle.com/technetwork/java/javase/downloads/index.html 
 


curl -v -j -k -L -H "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u25-b17/jdk-8u25-linux-x64.rpm > jdk-8u25-linux-x64.rpm

-j -> junk cookies
-k -> ignore certificates
-L -> follow redirects
-H [arg] -> headers
curl can be used in place of wget.

UPDATED FOR JDK 8u05

RPM:

 wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u5-b13/jdk-8u5-linux-x64.rpm
TAR GZ:

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

UPDATED ANSWER ON 6th September 2014 (JDK 7u67)

I am updating this answer to take into account the fact that Oracle has changed their cookie policy. Thanks to Det for pointing out a simpler method than what I had originally specified.

wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/7u67-b01/jdk-7u67-linux-x64.tar.gz

Once again, make sure you specify the correct URL for the version you are downloading. You can find the URL here: Oracle JDK download site

ORIGINAL ANSWER FROM 9th June 2012

If you are looking to download the Oracle JDK from the command line using wget, there is a workaround. Run the wget command as follows:

wget --no-cookies --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com" "http://download.oracle.com/otn-pub/java/jdk/7/jdk-7-linux-x64.tar.gz"
Be sure to replace the download link with the correct one for the version you are downloading.

#wget --no-cookies --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com" 
"http://download.oracle.com/otn-pub/java/jdk/7/jdk-7-linux-x64.rpm"
 
 
# mv jdk-7-linux-x64.rpm\?AuthParam\=1342770633_7d4af483447d5aa9054c35f58df2eb48 
jdk-7-linux-x64.rpm 
 
 
or
 
 

$wget --no-check-certificate --no-cookies --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com" "http://download.oracle.com/otn-pub/java/jdk/7u51-b13/jdk-7u51-linux-i586.rpm"

rsync with delete option and different ssh port

How to rsync e.g PIPELINE dir from Source to Destination? #rsync -avzr   --delete-before  -e "ssh -p $portNumber"  /local...