Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/scala/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
从何处获取提供scala.tools.nsc.MainGenericRunner的jar_Scala_Jar_Lift_Sbt - Fatal编程技术网

从何处获取提供scala.tools.nsc.MainGenericRunner的jar

从何处获取提供scala.tools.nsc.MainGenericRunner的jar,scala,jar,lift,sbt,Scala,Jar,Lift,Sbt,我有一个名为LiftConsole.scala的文件。它由项目创建脚本生成,包含以下内容 import _root_.bootstrap.liftweb.Boot import _root_.scala.tools.nsc.MainGenericRunner object LiftConsole { def main(args : Array[String]) { // Instantiate your project's Boot file val b = new Boo

我有一个名为
LiftConsole.scala
的文件。它由项目创建脚本生成,包含以下内容

import _root_.bootstrap.liftweb.Boot
import _root_.scala.tools.nsc.MainGenericRunner

object LiftConsole {
  def main(args : Array[String]) {
    // Instantiate your project's Boot file
    val b = new Boot()
    // Boot your project
    b.boot
    // Now run the MainGenericRunner to get your repl
    MainGenericRunner.main(args)
    // After the repl exits, then exit the scala script
    exit(0)
  }
}
这个文件的目的似乎是让用户从项目内部与控制台交互。我很想这样做,但我从来没能做到这一点,因为我找不到MainGenericRunner的jar。有人知道在哪里买吗


我的目标是能够初始化控制台的所有项目设置,这样我就可以执行特定于项目的代码

它是scala编译器.jar的一部分。您可以在Scala发行版的其余部分中找到它。将此添加到您的项目中:

val scalaCompiler = "org.scala-lang" % "scala-compiler" % "2.8.1"

我将该行作为项目定义中
libraryDependencies
的一部分。我仍然添加了您建议的行,但它仍然没有将其放入
lib\u managed
文件夹中。我可以在
project/boot/scala-2.8.1/lib/scala compiler.jar
中找到这个jar,如果我将它添加到构建路径中,那么我就可以将
LiftConsole.scala
作为scala应用程序运行,并显示控制台。最近我碰到了
sbt console
命令。这比
LiftConsole.scala
好得多。从它提供的控制台,我可以导入项目中包含的任何库,并且通常可以运行我想要的任何项目代码。