Running IntelliJ scala project error

108 views Asked by At

I am not using IntelliJ 15 for a long time, but never ever had such an issue. When I do: New Project -> Scala, then everything works fine, but when I do New Project -> SBT, then I can't even have main, because it gives me this:

Exception in thread "main" java.lang.ClassNotFoundException: testing at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at java.lang.Class.forName0(Native Method)

I did try deleting Make from Edit Configurations, I also tried adding Scala script in Edit Configurations, but still have this problem (it says scala script couldn't be found even though I linked it properly). Also, I read this topic:

How to run a Scala script within IntelliJ IDEA?

but haven't found solution. Thank you for your suggestions.

1

There are 1 answers

0
Cauchy On

Took me some time, but fixed - the problem was pretty much obvious. It was enough to go: File -> Project Structure -> Modules and add to Source Folders places where you create your scala file, or simply create scala script file in main -> scala.