Also, if you are a bit confused about how to install it, here is a nice video guide to installing, setting up, and compiling a simple hello, world program.
TheNewBoston – Free Educational Video Tutorials on Computer Programming and More! » Java Programming Tutorial – 1 – Installing the JDK
As to why you need the JDK. The JRE (Java Runtime Environment) simply runs java programs. The JDK (Java Development Kit) however contains tools for compiling Java source code (.java) into Java bytecode (.class) which is what is run by the JRE. So you can run Java programs without the JDK but you can't compile your own Java programs without the JDK.
Originally Posted by Panthereitor
I usually find this link very useful, so just in case if you are interested, have a look : Hello World
Hope that helps,