You have add the Path of the Java bin directory to the Windows PATH environment variable so that JDK programs are accessible on the command line from any path.

Right-click 'My Computer' and select Properties, goto Advanced tab and the click 'Environment Variables' button and the look for PATH in the System Variables section, click edit and append the path of Java bin directory to the existing entry.