Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.19.1 cannot run on java 8 due to UnsupportedClassVersionError #487

Closed
Elvis5566 opened this issue Jul 31, 2020 · 7 comments
Closed

0.19.1 cannot run on java 8 due to UnsupportedClassVersionError #487

Elvis5566 opened this issue Jul 31, 2020 · 7 comments

Comments

@Elvis5566
Copy link
Contributor

Do we need to upgrade jre11 to use slick-pg?
thanks

java.lang.UnsupportedClassVersionError: com/github/tminglei/slickpg/PgGeographyTypes$Geography 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

@tminglei
Copy link
Owner

tminglei commented Aug 1, 2020

Well, sorry! Wrongly transferred to java 11 on local when trying to resolve not found: value getClass because of scala/scala#8541, and then released it.
I'll downgrade it and release a new version again.

@tminglei
Copy link
Owner

tminglei commented Aug 1, 2020

@Elvis5566 resolved. Pls use v0.19.2 instead.

@tminglei tminglei closed this as completed Aug 1, 2020
@dhoepelman
Copy link
Contributor

dhoepelman commented Sep 9, 2020

Unfortunately we are getting this error when trying to upgrade from 0.19.0 to 0.19.2.
Could it be that the JTS 0.19.2 module is still compiled with JDK11?

$ sbt "dependencyList" | grep pg
[info] com.github.tminglei:slick-pg_2.13:0.19.2
[info] com.github.tminglei:slick-pg_core_2.13:0.19.2
[info] com.github.tminglei:slick-pg_jts_2.13:0.19.2
[info] com.github.tminglei:slick-pg_play-json_2.13:0.19.2
$ sbt test | grep java.lang.UnsupportedClassVersionError
java.lang.UnsupportedClassVersionError: com/github/tminglei/slickpg/PgGeographyTypes$Geography 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

@dhoepelman
Copy link
Contributor

Yep, confirmed it by manually inspecting the class file.
Note the header starts with cafe babe 0000 0037, the 0x37 byte corresponds to decimal 55 or JRE 11

$ wget https://repo1.maven.org/maven2/com/github/tminglei/slick-pg_jts_2.13/0.19.2/slick-pg_jts_2.13-0.19.2.jar
$ unzip slick-pg_jts_2.13-0.19.2.jar
$ cat com/github/tminglei/slickpg/PgGeographyTypes\$Geography.class | xxd | head -n 1
00000000: cafe babe 0000 0037 000c 0700 0707 000a  .......7........

@tminglei
Copy link
Owner

tminglei commented Sep 10, 2020

@dhoepelman yeah, slick-pg_jts and slick-pg_jts_lt are still built for Java 11. Others look well.
Don't know why. But I'll rebuild again.

@tminglei
Copy link
Owner

@dhoepelman resolved. pls turn to use v0.19.3.

@dhoepelman
Copy link
Contributor

0.19.3 solves the problem, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants