config
config copied to clipboard
Unsupported major.minor version 52.0
Using
private[this] val config = ConfigFactory.load()
in my test, results in the error below when running a simple scala test. See details below. I'm using JDK 1.7.0_75
ERROR
Could not run test TestSpec: java.lang.UnsupportedClassVersionError: com/typesafe/config/ConfigFactory : Unsupported major.minor version 52.0
Here is the build.sbt file:
name := "TestProject"
version := "1.0"
scalaVersion := "2.11.6"
scalacOptions ++= Seq("" +
"-unchecked",
"-feature",
"-deprecation",
"-encoding", "UTF-8")
libraryDependencies ++= {
val scalaTestVersion = "2.2.4"
val restAssuredVersion = "2.4.1"
val typesafeConfigVersion = "1.3.0"
val scalaLoggingVersion = "3.1.0"
Seq(
"org.scalatest" %% "scalatest" % scalaTestVersion % "test",
"com.jayway.restassured" % "rest-assured" % restAssuredVersion % "test",
"com.typesafe" % "config" % typesafeConfigVersion % "test",
"com.typesafe.scala-logging" %% "scala-logging" % scalaLoggingVersion
)
}
And here is the Spec class:
import com.typesafe.config.ConfigFactory
import org.scalatest._
class TestSpec extends FlatSpec with Matchers {
private[this] val config = ConfigFactory.load()
"This" should "work" in {
"test" should be ("test")
}
}
Since version 1.3.0, this library is only compatible with JDK8, see README.
@slandelle Ok, That explains. Thanks.
helpful, thanks
@lderks Just downgrade to 1.2.1 "com.typesafe" % "config" % "1.2.1",