Download and install J2SE on your machine. (If u face any problem in the process of downloading and installing follow https://techiesupport.wordpress.com/2012/07/24/installing-jdk-tutorial/ this may help you.
Configuring the installation on windows machine
In this Section we will add some settings to the windows environment so that the java compiler and runtime becomes available for compiling and running the java application.
Go to the control panel and double click on “System Properties” and to to the advance tab.
and add “c:\jdk1.5.0_06” to path variable:
and click on ok button. To save the setting click on “OK” button.
This will make the java environment available for development. Open the dos prompt and type javac on the console, you will find all the information regarding JDK
Now your development environment is ready for development.