Idea startup project: main class not found or cannot be loaded

in the process of using IDEA, the service is often broken or restarted. Recently, when the service is interrupted and restarted, a startup error is encountered:

error: the main class

cannot be found or loaded

guess: 1, failed to compile;

try: menu -> Build – “Rebuild Prodject

result: the startup service still reports the same error

2, caching problem;

try: menu — “File–” Invalidate Caches/Restart select Invalidate and Restart or just Invalidate, clear the cache, and then Rebuild Project

results: start successfully, problem solving

Read More: