I am getting a runtime exception when I try to run any java program after compiling it. The message I am getting is
Exception in thread "main" java.lang.NoClassDefFoundError: HelloWorld.
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.