Hi,
Follow this steps:-
1)Search javac.exe.
2)Then from command prompt go to the directory in which you have saved the program.
3)for example if you found javac.exe in c:\program files\java\jdk1.5.0_12\bin
and you saved
java program file in c:\priya> then give following command
c:\priya>set path=%path%;c:\program files\java\jdk1.5.0_12\bin;.;
press enter
4)for classpath give following command
c:\priya>set classpath=%classpath%;c:\program files\java\jdk1.5.0_12\bin;.;
press enter.