Launch4j-FakeMain compiled by more recent version Java Runtime(class file version 55 0)this Java Runtime only recognizes class file version up to 52 0

huangapple go评论137阅读模式
英文:

Launch4j-FakeMain compiled by more recent version Java Runtime(class file version 55 0)this Java Runtime only recognizes class file version up to 52 0

问题

这是我第一次尝试执行 .exe 文件的应用程序。
我正在使用 launch4j 来做这个。在执行和尝试运行之后,我收到了以下错误:

引用
Launch4j - 主线程异常 "main" java.lang.UnsupportedClassVersionError: FakeMain 已由更新版本的 Java Runtime 编译(类文件版本 55.0),而此版本的 Java Runtime 仅能识别高达 52.0 的类文件版本。

我搜索了关于 Java 版本的一些信息,所以我检查了我的 Java 版本,它们是相同的。

这是我的 Java 版本:
在命令提示符中的 Java 版本

也许我在那里做错了什么?
Launch4j 的截图

我不知道我能做什么。我整天都在努力修复这个问题,但一无所获。

尝试运行 .exe 文件后的错误

英文:

This is my first application that i try to execute exe.
I'm using launch4j to do this. After executing and trying to run, I get this error:

> Blockquote
Launch4j - Exception in thread "main" java.lang.UnsupportedClassVersionError: FakeMain has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0

I searched something about versions of java, so I checked my versions of java and they are the same.

That's my versions of java:
My versions of java in cmd

Maybe I did something wrong there?
Screen of Launch4j

I don't know what I can do. I spend all this day about fix this and nothing.

Error after try to run exe file

答案1

得分: 2

你已经使用Java 11作为目标编译了代码。但你的个人电脑想要使用不可能执行的Java 8版本来运行Java代码。

请确保你已经安装了正确的版本,并且确保可执行文件使用的是Java 11。

在这里,你可以找到Java版本与运行时版本的映射关系:Java版本号

该文章还提供了关于如何编译和执行正确版本的一些信息。

英文:

You have compiled the code with Java 11 as target. But your PC want's to execute the Java Code with Version 8, which is not possible.

Make sure you have installed the correct Versions and also make sure that the executable uses Java 11.

Here you can find the Java Versions mapped to the Runtime Versions: Java Version Numbers

The Article gives you also some information about how to compile and execute for the correct versions.

huangapple
  • 本文由 发表于 2020年9月8日 03:11:51
  • 转载请务必保留本文链接:https://go.coder-hub.com/63783058.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定