This problem should be very common, I often manually compile some test code or gadgets, often used in Javac and Java to compile and run some simple gadgets.
Test it with Hello World.
Helloworld.java
Public class helloworld{ publicstaticvoid Main (String[]args) { System.out.println ("The romatic greet of programmer all over the World:hello world!" ); }}
The following is the compile command
Error when trying to run
The class HelloWorld could not be found.
Later, after the investigation, the final problem appeared on Classpath. When setting user environment variables, you need to add them in front of classpath.;
To find the current directory when looking for classpath.
The following are the normal running code
If the system environment variable is not modified, it can be set manually in the compilation file Classpath
Set classpath=.; %classpath%
You can also enter this command at the command prompt.
Java error: The main class could not be found or could not be loaded