I recently updated scala from v2.11.8 to 2.12.1 and got a CNF exception:
java.lang.ClassNotFoundException: scala.Product$class
I saw the class is shipped by scala-library.jar. The error happens when running a scalatest (the project is still at a very early stage so I have only tests).
Do you have any idea? I found nothing on the release notes.
libraries are not binary compatible between 2.11 and 2.12, most likely one of your libraries has to be recompiled with scala 2.12
In particular, trait implementations are no longer provided in classes named with the $class
suffix. You'll find the notice about "trait encoding" in the release notes.
Probably you want to use sbt or ammonite if experimenting with any dependencies besides built-ins. One day they will have a tidy "platform" to help you.
$ cat notraitclass.scala
package notraitclass
trait T {
def t: Int = 42
}
$ scalac211 notraitclass.scala
$ ls notraitclass
T.class T$class.class
$ rm -rf notraitclass
$ scalac notraitclass.scala
$ ls notraitclass
T.class
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With