sunmingtao / sample-code

3 stars 4 forks source link

class file has wrong version 55.0, should be 52.0 #223

Closed sunmingtao closed 3 years ago

sunmingtao commented 3 years ago

Build a jar using java 11. Try to use it in the java 8 project.

bad class file: /Users/msun/.m2/repository/au/gov/nla/auth-common/1.0.0-SNAPSHOT/auth-common-1.0.0-SNAPSHOT.jar(au/gov/nla/auth/model/KeycloakAuthRequest.class)
[ERROR]     class file has wrong version 55.0, should be 52.0
[ERROR]     Please remove or make sure it appears in the correct subdirectory of the classpath.
sunmingtao commented 3 years ago

Java 8 project cannot use Java 11 library. The library needs to be rebuilt using java 8

https://www.quora.com/In-Java-how-do-you-fix-the-error-class-file-has-wrong-version-55-0-should-be-52-0