I am trying to run the docker image in AWS cloud so in the local ,compiled the application with jdk-11.0.1 and written docker file like this; Please note that I have not installed any JDK in AWS ec2 instance because I have already included adoptopenjdk/openjdk11:latest image in the final image..
FROM adoptopenjdk/openjdk11:latest
ADD target/demo-0.0.1-SNAPSHOT.jar app.jar
ENTRYPOINT ["java","-jar","app.jar"]
EXPOSE 8080
1)create the docker image
2)pushed the docker image to docker hub
3)when I run the docker container then getting below error.
Exception in thread "main" java.lang.UnsupportedClassVersionError: com/example/demo/DemoApplication 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