[java] 'Java' is not recognized as an internal or external command

For Windows 7:

  1. Right click on My Computer
  2. Select Properties
  3. Select Advanced System Settings
  4. Select Advanced tab
  5. Select Environment Variables
  6. Select Path under System Variables
  7. Click on Edit button
  8. In Variable value editor paste this at the start of the line

    C:\Program Files\Java\jdk1.7.0_72\bin;
    
  9. Click Ok then Ok again

  10. Restart command prompt otherwise it won't see the change to the path variable
  11. Type java -version in command prompt.


Notes on Step 8:
1. The version of java in this may be different from the one used here -- this is only an example.
2. There will probably be other values in the path variable. It is really important that you don't delete what's already there. That's why the instructions say to paste the given value at the start of the line -- this means that you don't remove the existing value, you just put java before it. This also fixes any problems you'd be getting if an other version of java is also on the path.

Notes on Step 6:
1. This sets the path for the computer, not for the individual user. It may be that you're working on a computer which other developers also use, in which case you'd rather set the user variables, rather than the system variables