What Windows are you running?
EDIT:
Your problem is that Windows does not know where Java is. Therefore, you must add it to your PATH Variable. Do the following to do just that:
Windows 7
Select Computer from the Start menu
Choose System Properties from the context menu
Click Advanced system settings > Advanced tab
Click on Environment Variables, under System Variables, find PATH, and click on it.
In the Edit windows, modify PATH by adding the location of the class to the value for PATH. (Example: C:\users\Santa Claus\java\) If you do not have the item PATH, you may select to add a new variable and add PATH as the name and the location of the class as the value.
Reopen Command prompt window, and run your java code.
Windows XP
Start -> Control Panel -> System -> Advanced
Click on Environment Variables, under System Variables, find PATH, and click on it.
In the Edit windows, modify PATH by adding the location of the class to the value for PATH. (Example: C:\users\Mrs. Claus\java\) If you do not have the item PATH, you may select to add a new variable and add PATH as the name and the location of the class as the value.
Close the window.
Reopen Command prompt window, and run your java code.
Windows Vista
Right click My Computer icon
Choose Properties from the context menu
Click Advanced tab (Advanced system settings link in Vista)
In the Edit windows, modify PATH by adding the location of the class to the value for PATH. (Example: C:\users\North Pole\java\) If you do not have the item PATH, you may select to add a new variable and add PATH as the name and the location of the class as the value.
Reopen Command prompt window, and run your java code.