

The JRE was just a subset of a JDK, with some of the tools removed. The JRE (Java Runtime Environment) is becoming passé as Oracle no longer expects end users in general to have a Java runtime installed on their systems. So basically there's not a JRE for java 17? If you feel the need and have the nerve, the cutting edge approach is to compile a native app using GraalVM technology from Oracle. The Java Platform Module System make it possible to strip the Java runtime down to only the parts actually used by your app. Modern Java offers the jlink & jpackage tooling to assist with bundling a Java runtime into your app. This way at compile-time you have complete control, so you can compile for Java 17 while also running on Java 17. Bundle a Java runtime within your app.Compile your app for Java 8, if your codebase does not use features from Java 9 and later.Yes, you understand the problem correctly: An app compiled for Java 17 cannot be run on a Java 8 runtime. To my understanding, this error means that my code is compiled with Java 17 but my JRE can run only Java 8 code. When I do that I get this error: : Main 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 52.0Īt 1(Native Method)Īt (ClassLoader.java:756)Īt (SecureClassLoader.java:142)Īt (URLClassLoader.java:473)Īt $100(URLClassLoader.java:74)Īt $1.run(URLClassLoader.java:369)Īt $1.run(URLClassLoader.java:363)Īt (Native Method)Īt (URLClassLoader.java:362)Īt (ClassLoader.java:418)Īt $AppClassLoader.loadClass(Launcher.java:352)Īt (ClassLoader.java:351)Īt (LauncherHelper.java:601)Įrror: A JNI error has occurred, please check your installation and try again After creating the JAR (building the artifact) I try to execute it with the JRE 1.8.0_311. I'm creating a JavaFX Application using IntelliJ and OpenJDK 17.
