Downloading the JDK from Oracle’s page from the command line

java, jdk, oracle

Since earlier in 2012, Oracle included a non-optional requirement that you need to Accept the T&C’s when downloading the JDK from their site. As you already agree the terms and conditions once you actually install or run the bin file, it isn’t absolutely necessary.

There’s a way around it using cookies, and I was able to download the file I needed when including the following cookie:

wget –no-cookies –header “Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F”http://download.oracle.com/otn-pub/java/jdk/6u37-b06/jdk-6u37-linux-i586.bin