[英]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我目前正在对我的 SoundSphere 程序进行最后润色,不幸的是,由于此错误,我似乎无法使用 launch4j 将 jar 文件转换为 exe 文件
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.我知道这与我在 java 16 中使用 fx 编写此程序有关,并且它只能使用 jre 识别版本 8。
My question is how would I go about fixing this / where can I get a jre for java 16?我的问题是我将如何 go 解决这个问题/我在哪里可以获得 java 16 的 jre?
Thank you for your time and any help感谢您的时间和任何帮助
Thomas Gustafson托马斯·古斯塔夫森
If you do not have it already get https://adoptopenjdk.net/如果你还没有它已经得到https://adoptopenjdk.net/
If you do, i guess that you then already have jre16 as it should be part of jdk16 .如果你这样做了,我猜你已经有了jre16因为它应该是jdk16的一部分。 It seems that you have older jre installed and set as default jre .
似乎您安装了较旧的jre并将其设置为默认jre 。 You need to change PATH in your environment variables to see java executable from jdk16 prior to jre8 .
您需要更改环境变量中的 PATH 才能在jre8之前从jdk16看到java可执行文件。
OR或者
You could use some JRE of 16 that has installer: https://adoptopenjdk.net/releases.html?variant=openjdk16&jvmVariant=hotspot您可以使用具有安装程序的 16 个 JRE: 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 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
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.