简体   繁体   中英

Java 16 jre version problem when converting jar to exe

I am currently working on the final touches for my SoundSphere program and unfortinately I can not seem to get the jar file to convert to a exe file with launch4j due to this error

Exception in thread "main" java.lang.UnsupportedClassVersionError: Main 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

I understand it has to do with the fact that I coded this program in java 16 with fx and it can only recognize up to version 8 with the jre.

My question is how would I go about fixing this / where can I get a jre for java 16?

Thank you for your time and any help

Thomas Gustafson

If you do not have it already get https://adoptopenjdk.net/

If you do, i guess that you then already have jre16 as it should be part of jdk16 . It seems that you have older jre installed and set as default jre . You need to change PATH in your environment variables to see java executable from jdk16 prior to jre8 .

OR

You could use some JRE of 16 that has installer: https://adoptopenjdk.net/releases.html?variant=openjdk16&jvmVariant=hotspot

For example windows x64 jre16 msi installer : https://github.com/AdoptOpenJDK/openjdk16-binaries/releases/download/jdk-16.0.1%2B9/OpenJDK16U-jre_x64_windows_hotspot_16.0.1_9.msi

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM