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: gpw_e24=http%3A%2%2Fwww.oracle.com%2F" "http://download.oracle.com/otn-pub/java/jdk/7u51-b13/jdk-7u51-linux-i586.rpm"
This no longer gets around the OTN license agreement as noted in this closed answer: https://stackoverflow.com/a/21431491/2144836
Trying this from my browser, I see the download link is adding an additional authentication in a query parameter:
http://download.oracle.com/otn-pub/java/jdk/7u51-b13/jdk-7u51-linux-i586.rpm?AuthParam=1392853518_cb83fe47e04500eecccdb66722756fb3
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?