The PATH environment variable tells the system where to find the java, javac, jar, and other executables. This enables you to compile Java classes, run your programs, make .jar files, and so forth, from any directory on your computer.
Navigate to Start > Control Panel > System.
Choose the Advanced tab.
Click Environment Variables .
In the System Variables pane, double-click the PATH variable. Scroll to the end of the list of variables, and add the following text (for default installation of SDK 1.5.0):