When I try to compile any Java program using the command prompt, the class file is successfully formed and compile time errors, if any are also displayed. However, when I run the program using the command:
java ProgramName
then the following error is displayed:
Could not find or load main class ProgramName
This happens for all the Java programs I have in my system. I have already checked that the class path and the environment variables are set. I am still unable to find the bug here.