To add jdk path to system varialbles follow below method
(This was written under window 8.1 64-bit version)
first you need to install valid java development kit (jdk) , can downloaded from oracle
Then install it.
You need to copy the installed path for the following directory (C:\programe files\java\jdk1.X.X\bin).
Then open 'advanced system settings' through system properties in your computer.
Then you can open 'Environmental variables' and there under 'system variables' you can find a entry called 'path' then edit it.(This is surely appending values and do not delete previous values)
Add ';'to the last variable value and paste copied jdk path to it.
Then Click OK and close those dialog boxes and to ensure path is correctly set try following.
Open new command prompt and type 'java -version' without quotes and press enter if it returns current java version in your system you are done.
for detailed instructions use these links
link1[
^]
link2[
^]
for the first link please skip the steps that describe 'create new folder named mydocs' and 'open that folder'.
Do not get confused with jdk version. they will vary according to the downloaded and installed version.