[Solved] IDEA Startup Error: Cound not Find or Load the main class

Problem Description: because computer is so laggy, after restarting, it opens the project. It finds that the function before is unable to use, and the wrong report: unable to find or unable to load the main class. Mainly clear the cache: use file → invalidate caches/restart, Select invalidate to clear the cache.

Solution:

1. Because I knew that the module name could not be started after changing the module name, I guess it caused the compilation problem, so try to rebuild, use Build→Rebuild Project.

But the problem has not been solved yet, and it is suspected to be a caching problem.

2. Use File→Invalidate Caches/Restart…, select Invalidate, and clear the cache.

 

3. Use File→Project Structure, select Modules on the left, click the minus sign to remove the problematic module, and then click the plus sign to re-import the module.

 

4. Restart the module and find the problem solved.

Similar Posts: