For Windows 7:[LIST=1]
- Right click on My Computer
- Select Properties
- Select Advanced System Settings
- Select Advanced tab
- Select Environment Variables
- Select Path under System Variables
- Click on Edit button
- In Variable value editor paste this at the start of the line
C:\Program Files\Java\jdk1.7.0_72\bin;
- Click Ok then Ok again
- Restart command prompt otherwise it won't see the change to the path variable
- Type java -version in command prompt.