etaty / rediscala

Non-blocking, Reactive Redis driver for Scala (with Sentinel support)
Apache License 2.0
790 stars 142 forks source link

UnsupportedClassVersionError #225

Open graineri opened 5 years ago

graineri commented 5 years ago

I'm wondering if version 1.8.0 or 1.9.0 were compiled using JVM 11 since I'm getting the following error when I run it using JVM 8:

java.lang.UnsupportedClassVersionError: redis/util/CRC16 has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0

Thanks!

farico commented 5 years ago

Same here for 1.9.0!

graineri commented 5 years ago

Re-compiling rediscala with JDK 8 does the trick.

I don't think we can assure that Scala is 100% compatible with JDK 11.

farico commented 5 years ago

Yes, but then you have to re-publish the artifact to use it?

graineri commented 5 years ago

Yes, that's correct.

etaty commented 5 years ago

Yes, the JVM I used to compile is JVM 11. It seems sbt / scala only support up to JVM 8, and it is the default target.

Also, i checked some of class files in the published jar and they are using version 52 (so JVM 8)

$ file unpack-red/redis/api/servers/Slaveof.class
unpack-red/redis/api/servers/Slaveof.class: compiled Java class data, version 52.0 (Java 1.8)
$ javap -verbose unpack-red/redis/RedisCluster.class | grep version
  minor version: 0
  major version: 52

So I am not sure what to do ... maybe only one file is breaking it?

graineri commented 4 years ago

Please check this file: redis/util/CRC16.

I am not sure why you have certain files with version 52.0 and others with 55.0.

vamsiampolu commented 4 years ago

@graineri Have you (by any chance) re published the artifact on a repository to use Java 8? If not, could you help me do that?

graineri commented 4 years ago

@vamsiampolu, I haven't re-published it to any public repository.

Sure. What do you need? You can try running sbt publishLocal and that should generate all the artifacts locally.