Skip to content

Intellij Error: Could not find or load main class

This tutorial will show how to quickly fix the Intellij Error: Could not find or load main class when running the main method of a class.

Intellij Error: Could not find or load main class com.bgasparotto.learningscala.scala.util.TryExamples

Process finished with exit code 1

Invalidate Caches and Restart

On Intellij, click on File -> Invalidate Caches / Restart as shown in the picture:

Intellij menu invalidate caches and restart

Then confirm on the next screen by clicking on Invalidate and Restart:

Intellij confirmation dialog for invalidate and restart

Feel free to add on the comments any other solution you may find.

Hope this helps. See ya!

Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *