Error: Could not find or load main class in intelliJ IDE

This might help:

1) “Build” menu -> “Rebuild Project“. Sometimes Intellij doesn’t rewrite the classes because they already exist, this way you ask Intellij to rewrite everything.

2) “Run” menu -> “Edit configuration” -> delete the profile -> add back the profile (“Application” if it’s a Java application), choose your main class from the “Main Class” dropdown menu.

3)”Build” menu -> “Rebuild Project“.

Leave a Comment