About the error found when the cmd command is running (classpath has been added): The main class xxx.class cannot be found or cannot be loaded

 

 Mine is this code, there is a problem that the main class cannot be loaded, I checked some answers, some said that I want to delete the package name (my did not bring the package, so it is not the problem), and some say that the classpath configuration is wrong, but When my java and javac test the jdk, it is normal, indicating that the configuration is correct, and then I saw that the installed jdk is 11 or 10. Just delete the classpath configuration (mine is jdk14), so I deleted it. Classpath this item, then reopen the command line cmd to run (remember to close and reopen the operation javac, java and the like), the result is normal output.

 

The above two pictures are some other solutions to this problem. It looks a bit circumvent. In simple terms, it is necessary to pay attention to the name path of the file. Can see

Guess you like

Origin www.cnblogs.com/zmlgoes/p/12756167.html