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!