If you want to write a small java program and run it from your PC then you need to have the following in your PC.
1. Java SDK and JRE – download from http://java.sun.com/javase/downloads/index.jsp
2. Text Editor – WordPad, TextPad, EditPlus etc.
After you have downloaded and installed Java SDK and JRE, you can execute the following in windows command prompt to the find the version of JRE installed.