Set up environment variables for JAVA from Windows GUI.
Right click on the My Computer icon on your desktop and select properties
Click the Advanced System Settings
Click the Environment Variables button
Under System/User variables, check for a variable named path.
If path already exists, click on edit to update. Go to the end of the entries in variable value, add semi-colon ; and add (installed location)/JDK as the value.
If path doesn’t exist, then click new on system/user variables Enter the variable name as path. Enter the variable value as the (installed location)/JDK
Click OK.