I have an issue with the java.lang.UnsupportedClassVersionError
error that is being thrown during my test executions. I understand the error and solved it before but in this case I am a bit lost.
This is the error messages (does appear for all test classes):
java.lang.UnsupportedClassVersionError: com/game/backend/resolver/QueryResolverTest 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
And this is my Dockerfile:
FROM gradle:6.6.1-jdk8 as builder
USER root
WORKDIR /builder
ADD . /builder
RUN gradle build --debug
FROM openjdk:11.0.8-slim
WORKDIR /app
EXPOSE 8082
COPY --from=builder /builder/build/libs/game-backend.jar app.jar
CMD ["java", "-jar", "app.jar"]
What I don't understand here is why he says it's compiled by a more recent version
?
The FROM gradle:6.6.1-jdk8
tells me it's JDK 1.8 which means it's class file version 52 (according to: List of Java class file format major version numbers?). So why is it saying the class was compiled by 55 (Java 11) ?