How can I force SBT to compile to Java 8 class files. I added scalacOptions += \"-target:jvm-1.8\" but it gives the following error message:
[error] \'jvm-1
You need the following on your build.sbt file.
javacOptions ++= Seq("-source", "1.8", "-target", "1.8", "-Xlint")
initialize := {
val _ = initialize.value
val javaVersion = sys.props("java.specification.version")
if (javaVersion != "1.8")
sys.error("Java 1.8 is required for this project. Found " + javaVersion + " instead")
}