IntelliJ & Scala – Could not load main class
This is one of the most common error we see when we get new code from a source repository. We might also see it when we create a new Scala project. As we run the application, the console shows could not load main class
The solution is simple. Just open module setting and see if the source folder for code has been correctly specified for the module which is being used to run the application.
Just make sure that the same module is selected in your debug configuration in Use class path of module option.