Set the path and classpath of the java directory as shown below.
1. Right Click My Computer and select properties.
2. click on Advanced tab and then click on Environmental variables button
3. click on New button of the system variables section and type the variable path as 'path' and variable value as 'java installed directory' + bin
(For eg: C:\Program Files\Java\jdk1.6.0_05\bin)