Cannot run Scala classes or objects in scala console

I have Scala plugin installed, and worksheets run fine. I can run classes and objects once the src/main/scala folder is specified as source root (why do we even need to manually do that, by the way?) but if I try "Run Scala Console" option I get this:


Exception in thread "main" java.lang.NoClassDefFoundError: scala/tools/nsc/interpreter/ILoop
at org.jetbrains.plugins.scala.compiler.rt.ConsoleRunner.main(
Caused by: java.lang.ClassNotFoundException:
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(
at java.base/java.lang.ClassLoader.loadClass(
... 1 more


Is this supposed to happen after you just install the plugin and try to run your program? I'm fairly new to this, so this all might sound naïve. And unlike running Java programs it seems that if I want to take input like the "args" array when extending App, I can't do it by running normally. That's why I try to run scala console since someone pointed me to that.


Any help is very much appreciated, thanks a lot!