One thing you should do is :
Write the path in the autoexec.bat file.
for e.g. path=d:\jdk1.3\bin;d:\jdk1.3\lib
here, d: is where your jdk1.3 is installed. use your own version of jdk.
Thus, put the path of the jdk for both the bin and the lib and then save
autoexec.bat file. and close it.
Run the autoexec.bat file at the command prompt by giving the command "autoexec"
at the root. and then try running your HelloWorld program. It must run.
If you encounter a problem that your compiler throws the error like "javac is
not the internal command.... " or something similar to it, then try running the
autoexec.bat file everytime you open the new command prompt...
try thins and let me know if it works... according to me it should...