Kindly check the path of your java program.
It seems you have not mentioned file path correctly.
For example if you open the cmd prompt you can see the path like this
C:\Documents and Settings\ramsri>
If your java program in your d:java program
you have to change the cmd prompt accordingly
So it will be like this
d:\java program>
After that give javac your_ProgramName.java
after compilation complete give java your_ProgramName
Surely it will work