launch4j/OneJAR 打包的 .exe 文件已损坏

发布于 2024-12-28 05:55:08 字数 388 浏览 8 评论 0原文

我正在使用 OneJAR 将我的应用程序打包到一个 jar 中。

OneJAR 创建的 .jar 文件在 Windows 上完美启动,并且 JOGL 代码运行良好。

然后我使用 launch4j 将这个 .jar 文件转换为 .exe 文件。

当我尝试执行该文件时,Windows (7) 报告该文件已损坏。

我的应用程序包含一些我怀疑可能相关的本机代码(JOGL DLL)。

如果我创建一个没有 OneJAR 的可执行 jar 并将其转换为可以启动的 .exe,尽管它会抱怨缺少 JOGL DLL(当然,因为它们不能包含在没有像 OneJAR 这样的东西的 jar 中)。

那么有没有人让 OneJAR+launch4j+DLL 的组合起作用,或者这是行不通的?

I'm using OneJAR to package my application into a single jar.

The OneJAR created .jar file launches perfectly on Windows and the JOGL code runs fine.

I then I turn this .jar file into an .exe file using launch4j.

When I try to execute that file, Windows (7) reports that the file is corrupt.

My application includes some native code (JOGL DLL's) which I suspect maybe related.

If I create an executable jar without OneJAR and turn this into .exe that lauches alright, though it the complains about the missing JOGL DLL's (naturally as they cannot be included in the jar without something like OneJAR).

So has anyone made that combination OneJAR+launch4j+DLLs work or is this something that is not going to work?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

嘿哥们儿 2025-01-04 05:55:08

尝试 JarSplice,它对我来说与 Launch4j 配合得很好。

try JarSplice, it worked fine for me with Launch4j.

廻憶裏菂餘溫 2025-01-04 05:55:08

问题解决,请参阅我对加文答案的评论,我的愚蠢错误。

呸,我的愚蠢错误,抱歉产生了噪音。问题是
我的 Ant 脚本有一个 jstub Ant 任务破坏了 .jar 文件
在 launch4j 有机会发挥其魔力之前。所以我可以报告
OneJAR 和 launch4j 完美配合,强烈推荐。

Problem solve, see my comment on Gavin's Answer, silly mistake of mine.

Bah, silly mistake of mine, sorry about the noise. The problem was
that my Ant-script had a jstub Ant-task that mangled the .jar file
before launch4j had a chance to do its magic. So I can report that
OneJAR and launch4j work perfectly together, highly recommended.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文