When Compiling Java application in Dos command, showing an error, sometimes it may reason for not to setup the PATH Variable. to setup the Path variable simply add the location drive where the JDK/bin located in PATH Variable. Here is the way how I setup the path variable:
Right click on My Computer and go to the Properties
choose Advance Tab and then click on Environment Variable
Edit Environment Variable Select PATH and then Edit the Location where the JDK bin directory append with ";" semicolon first. here is my Path setup JDK Location:
;C:\Program Files\Java\jdk1.7.0\bin
click OK and test on DOS prompt make sure Path command is working and Location is right. The image below showing Path Variable successfully setup :