class file version 54.0,Java Runtime only 52.0, while trying to run docker

505 Views Asked by At

Im trying to dockerize my application and when I try to run the docker run command, I receive this error. I tried a lot of things where people say that java and javac are different versions, but they are the same; What is the problem in the situation and how can I resolve it? I will apply picture of the error, so you can see it. Also do I need to go back to previous version of java and how to do this? Thanks in advance! :)

Error

1

There are 1 best solutions below

4
On

You have compiled your code with Java 10. Your docker has Java 8 runtime environment.