Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't import with IntelliJ SBT console

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?

like image 833
DennisVDB Avatar asked Sep 22 '13 00:09

DennisVDB


1 Answers

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 edit configs window

The import appeared to work after that.

like image 155
Luciano Avatar answered Sep 30 '22 16:09

Luciano