rediscala icon indicating copy to clipboard operation
rediscala copied to clipboard

UnsupportedClassVersionError

Open graineri opened this issue 5 years ago • 8 comments

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!

graineri avatar Aug 21 '19 02:08 graineri

Same here for 1.9.0!

farico avatar Aug 26 '19 15:08 farico

Re-compiling rediscala with JDK 8 does the trick.

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

graineri avatar Aug 26 '19 16:08 graineri

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

farico avatar Aug 27 '19 07:08 farico

Yes, that's correct.

graineri avatar Aug 30 '19 19:08 graineri

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?

etaty avatar Sep 06 '19 23:09 etaty

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.

graineri avatar Nov 01 '19 20:11 graineri

@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?

vamsiampolu avatar Jun 01 '20 03:06 vamsiampolu

@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.

graineri avatar Jun 01 '20 10:06 graineri