我無法將scala-reflect
添加爲依賴項。我project/build.sbt
看起來是這樣的:無法添加scala-reflect作爲依賴關係
//the name of the project, will become the name of the war file when you run the package command.
name := "Test-SBT"
version := "1.0"
//specify which Scala version we are using in this project.
scalaVersion := "2.10.3"
libraryDependencies <++= (scalaVersion)(sv =>
Seq(
"org.scala-lang" % "scala-reflect" % "2.10.3",
"org.scala-lang" % "scala-compiler" % "2.10.3"
)
)
而且project/build.properties
sbt.version=0.13.0
這裏是我的主類:
object Main1 extends App {
import scala.reflect.runtime.universe
val runtimeMirror = universe.runtimeMirror(getClass.getClassLoader)
//......
}
它說object runtime is not a member of package reflect
。當然,我做了「gen-idea」,「clean」和其他東西。那是怎麼回事?
您確定,您在第一個列表中顯示'project/build.sbt',而不僅僅是'build.sbt'? – laughedelic
@laughedelic絕對。 –