I installed Intellij's official SBT plugin (still in alpha), I imported without a problem a Scala SBT project (with build.sbt). But when I try to import something in the Scala console it prints this:
<scala> import recfun.Main._
<console>:7: error: not found: value recfun
import recfun.Main._
But when I launch exactly the same command with SBT running in the terminal it works fine.
What is the problem?
I found the following helped. I was working on a program imported using the SBT plugin, that had multiple sub-projects. This may also work if you have a native IntelliJ project with multiple modules.
Go to the menu "run -> Edit configurations ...", select Scala Console
, and then in the box that says "Use classpath and SDK of module", pick the sub-project that has the build.sbt
with the import statements you need (in my case server
):
The import appeared to work after that.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With