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:
Then confirm on the next screen by clicking on Invalidate and Restart:
Feel free to add on the comments any other solution you may find.
Hope this helps. See ya!