Could not find or load main class in scala in intellij IDE

Probably you imported project somehow wrong. I see scala folder is not highlighted as sources. Usually, you don't even need to setup Run configuration manually for Scala SBT project. Do you have Scala and SBT Plugins in your IDE?

You should open SBT projects through "Import project" and choose "build.sbt" file. I would also recommend enabling auto-import to install all of the dependicies.

That's how it look for me: Here how it looks for me

If you still wanna make it manually your configuration should work. That's my Run configuration that works:

My run configuration


My problem was resolved when I marked src folder as sourced root. Click with the right button in src folder -> Mark Directory as -> Sources root


To fix this issue in my project I invalidated caches and restarted:

enter image description here


You will get this error if you tried to open the project and imported it incorrectly. I would open the project like this in Intellij:

File>New> Project from Existing Source>(select) Import project from external model>
(select)sbt

click Next>Finish