I am trying to get an interactive shell in my Scala application. I am using the following system:
- Scala 2.10.0
- sbt 0.12.2
- Akka 2.1.0
- sbt-lwjgl-plugin 3.1.4
and the following non-working code:
import akka.actor.Actor import scala.tools.nsc.Settings import scala.tools.nsc.interpreter.IMain class TestActor extends Actor { def receive => { case _ => { val settings = new Settings settings.usejavacp.value = true settings embeddedDefaults ActorSystem.getClass.getClassLoader val repl = new IMain(settings) repl.interpret("import java._") // working repl.interpret("import scala._") // working repl.interpret("import akka._") // not working repl.interpret("import other.java.class.Bar") // not working } } }
Sbt is set to fork := true . I tried several settings and class path configurations, but did not find a working configuration. Can someone give me a hint / solution to this problem?
source share