config icon indicating copy to clipboard operation
config copied to clipboard

Unsupported major.minor version 52.0

Open lderks opened this issue 11 years ago • 4 comments

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")
  }

}

lderks avatar May 18 '15 14:05 lderks

Since version 1.3.0, this library is only compatible with JDK8, see README.

slandelle avatar May 18 '15 14:05 slandelle

@slandelle Ok, That explains. Thanks.

lderks avatar May 18 '15 14:05 lderks

helpful, thanks

lgrcyanny avatar Aug 30 '15 14:08 lgrcyanny

@lderks Just downgrade to 1.2.1 "com.typesafe" % "config" % "1.2.1",

cevaris avatar Oct 06 '15 16:10 cevaris