scala之在哪里获取提供 scala.tools.nsc.MainGenericRunner 的 jar
unruledboy
阅读:11
2024-11-24 20:56:43
评论:0
我的 Lift 项目有一个名为 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-compiler.jar
的一部分。您可以在其余的 Scala 发行版中找到它。将此添加到您的项目中:
val scalaCompiler = "org.scala-lang" % "scala-compiler" % "2.8.1"
声明
1.本站遵循行业规范,任何转载的稿件都会明确标注作者和来源;2.本站的原创文章,请转载时务必注明文章作者和来源,不尊重原创的行为我们将追究责任;3.作者投稿可能会经我们编辑修改或补充。