0

I'm getting the following error when I'm running my main class:

Error: LinkageError occurred while loading main class Main java.lang.UnsupportedClassVersionError: Main has been compiled by a more recent version of the Java Runtime (class file version 60.0), this version of the Java Runtime only recognizes class file versions up to 59.0

I set the Compiler Complience level in eclipse to 16 and set the JRE to jre1.8.0_291 (most recent on the Oracle website). Which JRE do I need to run the code compiled by JDE 16?

Algoman
  • 3
  • 2
  • you have to set also the JRE to 16 – JHDev Apr 26 '21 at 22:15
  • I downloaded the most recent JRE from Oracle, which was jre1.8.0_291 and set it in eclipse. is this JRE not compatible with JDK 16? Where can I find a more recent JRE if it is not compatible? – Algoman Apr 27 '21 at 07:23
  • I Try to download the JDK 16 from Oracle – JHDev Apr 27 '21 at 10:50
  • You might download a Java 16 JRE or JDK e.g. from [adoptopenjdk.net](https://adoptopenjdk.net/) since for Java 9 and higher Oracle does only provide JDKs. A JDK is a JRE with some additions useful for development but not needed to run a Java application (source code, etc.). So using a JDK instead of JRE will also work. – howlger Apr 27 '21 at 11:39
  • Thanks for your answers. I downloaded the Java 16 JDK from adoptopenjdk.net and set it as an JRE in Eclipse. When I set the Compiler Compliance Level to 15 it works well, but when I set it to 16 I get the same error as before. Does something else need to be changed? – Algoman Apr 29 '21 at 08:32

0 Answers0