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](https://bgasparotto.com/wp-content/uploads/2020/11/intellij-invalidate-caches-restart.png)
Then confirm on the next screen by clicking on Invalidate and Restart:
![Intellij confirmation dialog for invalidate and restart](https://bgasparotto.com/wp-content/uploads/2020/11/intellij-invalidate-and-restart.png)
Feel free to add on the comments any other solution you may find.
Hope this helps. See ya!