I have set the path to set path = C:\j2sdk1.4.2_07\bin; and classpath to set classpath = .;C:\j2sdk1.4.2_07\lib;. I have even tried to place the program in the bin folder of j2sdk1.4.2_07 but am still getting the same exception.
If you've set CLASSPATH, and set it wrong, then Kameron's instructions won't work; I suspect that's already what you're trying. What you need to do is quickly tell java to ignore whatever you've set as the CLASSPATH, and the easiest way to do that is to specify a value on the command line. So try
java -cp . HelloWorld
That's java space dash cp space dot space HelloWorld.