Saturday, November 30, 2013

How to download Java 7u45 Ubuntu console or terminal using WGET command?

When downloading a Java JDK installer using a simple "WGET" command from Ubuntu terminal or Mac OS terminal, you will end of getting an HTML file because it requires you to click the "Accept agreement..." from the web browser. In my case I need to download it from a console or terminal because my server doesn't have ubuntu-desktop GUI installed.

To make the WGET command work from a terminal or console and download the Java JDK 7, use the command below:
wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com" "http://download.oracle.com/otn-pub/java/jdk/7u45-b18/jdk-7u45-linux-x64.tar.gz"
The code snippet above is the command that I used to download the JDK 7u45 into my Ubuntu 12.04 64 bit Server from a terminal perspective. The command is just a one line.

Hope it helps for those who are looking for a quicker way.

That's all. 

1 comment:

Anonymous said...

Thanks for the tutorial. It really save my time googling for solution. I'm new to Linux server installation.