Package Class failures (Scalac)

Hi,

When running the Engine class, I’m getting Package Class failures in Scala libraries, its expecting version 5.0 but found 5.2.

This looks to be coming from the maven integration, I’ve checked my global libraries and have 2.12.2 installed and JDK 1.8?. It looks like when doing the maven archetype generation etc its installing a package class of 3.6 (m2) ?.

It’s related to the JDK version you compiled for/with: List of Java class file format major version numbers? - Stack Overflow

Your class files have the format of JDK 8, which is the minimum version required for Scala 2.12 and up, so that’s normal. And it appears you are trying to run your code on a JRE of version 6 (I assume you robbed a museum?). So unfortunately that’s not going to work. Relatively modern versions of Scala require at least Java 8.

You may also want to upgrade your Scala version to at least 2.12.14. There should be no reason to stay on such an old minor version.

1 Like

Or I may have read your post wrong. Although it’s also helpful if you provided the exact error message you’re getting.

These versions are probably related to the scala signatures in the class files. See this issue for instance. In particular:

“expected: 5.0 found: 5.2” looks like you are trying to use the 2.12 compiler with a 2.13 library

1 Like

Yeah thanks for reply. that’s the issue, not sure why the compiler is bringing in 2.13 on the package class.

You have some (possibly transitive) dependency that is compiled with 2.13.