1
resposta

jar executavel - erro ao executar via linha de comando no PROMPT

prezados, estou tentando executar via PROMPT o JAR mas acontece o erro abaixo: o que faço para resolver ?

Exception in thread "main" java.lang.UnsupportedClassVersionError: br/com/empresa/projeto/teste/TesteSaca has been compiled by a more recent version of the Java Runtime (class file version 59.0), this version of the Java Runtime only recognizes class file versions up to 52.0
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(Unknown Source)
        at java.security.SecureClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.access$100(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
1 resposta
TesteSaca has been compiled by a more recent version of the Java Runtime (class file version 59.0), this version of the Java Runtime only recognizes class file versions up to 52.0

Você compilou a classe "TesteSaca" com Java 15 mas está tentando rodar com Java 8, provavelmente você tem o JDK instalado na versão 15 na sua máquina e o JRE na versão 8, precisa deixar ambas na mesma versão.