Here’s a one-liner to get around evil Oracle’s “click the EULA” nonsense, and download their stupid JDK from the linux shell (in this case, the rpm version):
wget --no-cookies --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2Ftechnetwork%2Fjava%2Fjavase%2Fdownloads%2Fjdk-7u17-download-1501626.html;" http://download.oracle.com/otn-pub/java/jdk/7u17-b02/jdk-7u17-linux-x64.rpm --no-check-certificate -O jdk-7u17-linux-x64.rpm
Note that you’ll have cruft at the end of the filename after downloading unless you use the -O option (thanks Byron).
For other downloads, just change the target and output.
What fun. Original magic cookie fu by this guy, thanks!
Add the -O at the end of the line to specify an exact file name. This will give you a useful file name such as ‘jdk-7u17-linux-x64.rpm’
instead of ‘jdk-7u17-linux-x64.rpm?AuthParam=1370449659_2617a75e2f02e6a0b56dc87cd02ada0f’
Example:
wget –no-cookies –header “Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2Ftechnetwork%2Fjava%2Fjavase%2Fdownloads%2Fjdk-7u17-download-1501626.html;” http://download.oracle.com/otn-pub/java/jdk/7u17-b02/jdk-7u17-linux-x64.rpm –no-check-certificate -O jdk-7u17-linux-x64.rpm
Thanks Byron!! I updated the post.
Great help, many thanks!