title: How to call the scala interpreter in a Simple Build Tool project?
body: <p>my scala program is using the compiler interface from scala.tools.nsc.interpreter.IMain. When I am compiling with scalac, everything works as expected. But when I compile with sbt it still compiles, but on execution it throws the following error message in the call of the interpret-method from the IMain instance:</p>
  
  <pre><code>Failed to initialize compiler: object scala not found.
  ** Note that as of 2.8 scala does not assume use of the java classpath.
  ** For the old behavior pass -usejavacp to scala, or if using a Settings
  ** object programatically, settings.usejavacp.value = true.
  </code></pre>
  
  <p>If I use settings.usejavacp.value = true on the IMain instance, I get the following exception:</p>
  
  <pre><code>java.lang.Error: typeConstructor inapplicable for &lt;none&gt;
  </code></pre>
  
  <p>My SBT project definition:</p>
  
  <pre><code>class Project(info: ProjectInfo) extends DefaultProject(info){
      val scalaSwing = "org.scala-lang" % "scala-swing" % "2.9.0"
      val scalaCompiler = "org.scala-lang" % "scala-compiler" % "2.9.0"
  }
  </code></pre>
  
  <p>What's wrong here? And how can I use the interpreter in a Simple Build Tool Project?</p>
  
  <p>I'm using <strong>Scala 2.9.0</strong> and <strong>Simple Build Tool 0.7.7</strong></p>