Preface
When running the project today, an error occurred suddenly: IDEA error cannot find or cannot load the main class
Problem report
Could not find or load the main class
This is how the CSDN big guys solved the
error: the main class could not be found or could not be loaded.
Guess: 1, failed to compile successfully;
try: menu—"Build—"Rebuild Prodject
result: start the service and still report the same error
2, cache problem ;
Try: Menu—"File—"Invalidate Caches/Restart Select Invalidate and Restart or just Invalidate, clear the cache, and then Rebuild Project.
Result: Successful startup, problem solved
solution
file—>Project Structure
Click on Moudles in Project Settings—>click on the minus sign to delete all Moudles
Click on the + sign to re-introduce Moudle
Find the pom file in the parent folder of the project—>OK
Rebuild Project is a
perfect solution
Write at the end
The reason for this problem may not stop there. I hope that friends with different opinions will discuss (si) and (bi) in the comment section!