【发布时间】:2016-06-30 01:01:51
【问题描述】:
给定:
$cat build.sbt
scalaVersion := "2.11.8"
libraryDependencies ++= List(
"io.spray" %% "spray-client" % "1.3.3"
,"io.spray" %% "spray-json" % "1.3.2"
,"com.typesafe.akka" %% "akka-actor" % "2.4.2"
,"com.typesafe" % "config" % "1.3.0"
,"org.scalatest" % "scalatest_2.11" % "2.2.6" % "test"
)
使用这个answer,我尝试使用JDK 7。
但是,我收到以下错误:
$sbt -java-home /Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home/ clean test
[info] Loading project definition from /Users/Kevin/Workspace/Work/project/project
[info] Set current project to project (in build file:/Users/Kevin/Workspace/Work/project/)
[success] Total time: 0 s, completed Mar 14, 2016 3:51:10 PM
[info] Updating {file:/Users/Kevin/Workspace/Work/project/}project...
[info] Resolving jline#jline;2.12.1 ...
[info] Done updating.
[info] Compiling 9 Scala sources to /Users/Kevin/Workspace/Work/project/target/scala-2.11/classes...
[error] Class java.time.Duration not found - continuing with a stub.
[error] Class java.time.Duration not found - continuing with a stub.
[error] two errors found
[error] (compile:compileIncremental) Compilation failed
[error] Total time: 5 s, completed Mar 14, 2016 3:51:16 PM
看着这个answer,我猜测/推测我需要添加一个 java8 时间库作为依赖项?
【问题讨论】:
-
那么这是否意味着我的依赖项之一正在使用 JDK8 的
java.time.Duration?