I never thought I would have to write this article. Downloading Java was the simplest thing possible. Just go to java.sun.com and download the JDK. Unfortunately Sun has (intentionally?) complicated the procedure to such an extent that it almost takes an expert to download the proper version of JDK and without any extra and often unnecessary baggage.

Let's call this article: The Art of Downloading & Installing JDK 6

What is the difference between JDK and JRE?

JDK is Java Development Kit. In simple words it contains programs (like javac ) to help you develop Java code. Any java develoepr must always download the JDK and not JRE. JDK includes everything JRE has and much more.

JRE is the Java Runtime Environment. In simple words it should be downloaded by anyone wishing to run Java Programs (Java applications, Java applets & Java WebStart Applications). Any Java user, other than a developer, should download JRE.

How can you download JDK 1.6?

Go to http://java.sun.com

On the right sidebar notice a section titled Popular Downloads. In there click on the link Java SE.

Ignore the section titled Java SE Development Kit (JDK) Bundles. Scroll down to the next section: Java SE Development Kit (JDK).

Now click on the Download link next to JDK 6 Update 16.
Note: In future the update number may increase as new fixes are released. When JDK 7 will be released, the link will also be named correspondingly.

Select the platform. You can see that downloads for Linux, Windows and Solaris is available. Choose 64 bit version if you have 64 bit operating system installed.
Note: I use Cent OS 64 bit, for example. So I selected Linux x64.

Check the checkbox next to I Agree to the Java SE Development Kit 6u16 License Agreement and click on Continue button.

Now you may find more than one download links. Choose the one more appropriate to your environment. Note: For Fedora, CentOS, RHEL systems, you should choose the link ending with rpm.bin. For example, I downloaded jdk-6u16-linux-x64-rpm.bin.

Finally, downloading should begin. Wait for the jdk download to complete.

How to install JDK 6 on Windows

Just double-click the executable and go with the default options

How to install JDK 6 on Linux

Login as root or su to root.

Open and terminal and go to the download directory.

chmod the permission of the file to 755. For example I did:
chmod 755 jdk-6u16-linux-x64-rpm.bin

Run the executable. For example I did:
./jdk-6u16-linux-x64-rpm.bin

Read the license by using PageDown key till you reach the end. Agree to the license terms by typing yes and then pressing Enter. Installation should proceed normally.
Note: At the very end you will be asked to press Enter again. It will open a browser window and ask you to register the JDK. It is optional.

Whew, finally you are done!