0 0 0 0


There is this lovely answer on how to automate the download of the Java JDK on Linux:Downloading Java JDK on Linux via wget is shown license page instead

The method described no longer works. It seems Oracle has once again changed the restrictions on their download servers to block this method. I suppose they do not want Java to be used in autoscaling server systems like AWS. What are they thinking?

The specific command I am trying is to download the latest 7u51 version to an AWS server so I can install my web applications:

wget --no-cookies --no-check-certificate --header "Cookie:" ""

This no longer gets around the OTN license agreement as noted in this closed answer:

Trying this from my browser, I see the download link is adding an additional authentication in a query parameter:

Copying and pasting this link with the AuthParam into the wget call does not work either. My initial guess is that it is tied to a session or IP address.

It is not reasonable to try downloading this manually to a server (or to a hundred servers a hundred times a day), so I am hoping for a workaround that will work with the current restrictions.

So TODAY, is there a workaround for automating the download of the latest JDK? Or should I just give up on Oracle entirely?

Best Answer:

Your command works just fine for me. Check below:

$ ls jdk*
ls: cannot access jdk*: No such file or directory
$ wget --no-cookies --no-check-certificate --header "Cookie:" ""
--2014-02-20 14:03:49--
Connecting to||:80... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: [following]
--2014-02-20 14:03:50--
Connecting to||:443... connected.
WARNING: certificate common name `' doesn't match requested host name `'.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: [following]
--2014-02-20 14:03:50--
Reusing existing connection to
HTTP request sent, awaiting response... 200 OK
Length: 121271382 (116M) [application/x-redhat-package-manager]
Saving to: `jdk-7u51-linux-i586.rpm'
100%[=================================================================================================================================>] 12,12,71,382  381K/s   in 4m 14s  
2014-02-20 14:08:04 (466 KB/s) - `jdk-7u51-linux-i586.rpm' saved [121271382/121271382]
$ ls -l jdk*
-rw-r--r-- 1 root root 121271382 2014-02-11 00:10 jdk-7u51-linux-i586.rpm

What error do you get when you run this command? I tried your command in 3 different places and it worked every time.

Copyright © 2011 Dowemo All rights reserved.    Creative Commons   AboutUs