Quanto tento executar o comando docker run -p 3080:8080 forum
, ele apresenta o erro abaixo. Já tentei trocar a configuração do arquivo Dockerfile para jdk14, jdk15 mas não adiantou e a minha versão do java no pom.xml é : <java.version>17</java.version>
<kotlin.version>1.6.21</kotlin.version>
Exception in thread "main" java.lang.UnsupportedClassVersionError: br/com/alura/forum/ForumApplicationKt has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 58.0 at java.base/java.lang.ClassLoader.defineClass1(Native Method) at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1017) at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:151) at java.base/java.net.URLClassLoader.defineClass(URLClassLoader.java:514) at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:422) at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:416) at java.base/java.security.AccessController.doPrivileged(AccessController.java:691) at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:415) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:589) at org.springframework.boot.loader.LaunchedURLClassLoader.loadClass(LaunchedURLClassLoader.java:151) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522) at java.base/java.lang.Class.forName0(Native Method) at java.base/java.lang.Class.forName(Class.java:427) at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:46) at org.springframework.boot.loader.Launcher.launch(Launcher.java:108) at org.springframework.boot.loader.Launcher.launch(Launcher.java:58) at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:65)
Meu arquivo Dockerfile :
FROM adoptopenjdk/openjdk14
EXPOSE 8080
ADD /target/forum-0.0.1-SNAPSHOT.jar forum.jar
ENTRYPOINT ["java","-jar","forum.jar"]