We are all used to downloading the JDK from Oracle using the browser. You will have to accept the licence to proceed with the download.

This makes it tricky to download on a Linux installation without or you don’t have access to its GUI. Trying to use wget will download an HTML page insisting you accept the licence. There are a couple of ways to get round ‘Accept Licence’ issue including the plain old download on local machine and upload to the remote machine. The simplest I got was to add the authentication parameter that’s used by the download server to verify if you have accepted the license to the JDK download URL used by wget.

The solution to get the precious AuthParam cookie, in this post I use Google Chrome to retrieve it. On the download page right click and select “Inspect Element”. Select the “Network” tab on the debugging window. After accepting the licence on the browser click on the file to download it. Quickly cancel the download and check the Network output. Right click the last result and copy the link.

wget http://download.oracle.com/otn-pub/java/jdk/7u5-b06/jdk-7u5-linux-x64.tar.gz?AuthParam=your_unique_parameter will download the JDK.