If you are using windows then follow these steps
1. Install JDK.
2. After completing the installation of JDK you have to set the classpath variables.

To set the classpath follow the instructions...