Sometimes, when testing a class, eclipse can be a strange reminder that you can't find the main class. Next there are several workarounds
1. On the project, right click on the > Builder path, Configure Build path, select the source panel and click Add Folder to add the upper directory of the package path where the source code resides, and if you are writing two classes in a file When you right-click the run as Java appication, you want to place the cursor on the class that includes the Main method
2 Copy and paste the class with the main function create a new class copy the code in. OK
3 Rebuilding a Java project directly
If it doesn't work, test Java on the command manager if you don't see if the environment variable is incorrect or reinstalled
Personal homepage: https://blog.pangyd.com/index/article/show/id/56.html
Eclipse cannot find the main class if there is a main function