java.lang.NoClassDefFoundError: scala/Product$class

落花浮王杯 提交于 2019-11-30 06:22:48

your sbt build file is not right. your scala version is 2.12.x but you are using libraries compiled in scala version 2.11. use the sbt settings shown below

note: I changed the version of scalatest as 2.x versions are no longer supported for 2.12 version of scala

scalaVersion := "2.12.1"

libraryDependencies ++= Seq(
  "org.scala-js" %% "scalajs-test-interface" % "0.6.14",
  "org.scalatest" %% "scalatest" % "3.0.1", //version changed as these the only versions supported by 2.12
  "com.novocode" % "junit-interface" % "0.11",
  "org.scala-lang" % "scala-library" % scalaVersion.value
)

remember to do reload, clean and compile in your sbt console to start clean compile

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!