Java:将jar嵌入exe内 [英] Java: embedding jar inside exe

查看:110
本文介绍了Java:将jar嵌入exe内的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下是显示我的意思的示例: http://www.minecraft.net/download.jsp 如果使用winrar打开Minecraft.exe,则可以看到jar清单和类,并且实际上可以像这样java -jar Minecraft.exe

Here is example to show what i mean: http://www.minecraft.net/download.jsp If you open the Minecraft.exe with winrar you can see the jar manifest and classes and you can actually launch the jar like this java -jar Minecraft.exe

但是,当我尝试将jar作为资源嵌入到自己的exe文件中时(我可以通过winrar看到与minecraft.exe中的类相同的类),并使用java -jar启动它,但消息失败

But when i tried to embed my jar to my own exe as resource (i can see the classes same way as in minecraft.exe with winrar) and launch it with java -jar it fails with message

invalid or corrupt jar file

如何将jar正确嵌入exe?这样可以与minecraft.exe一样启动该程序吗?

How can i embed the jar to exe correctly? so it can be launched same way as minecraft.exe?

推荐答案

使用JSmooth.我们成功地使用了它

Use JSmooth. We use it with much success

这篇关于Java:将jar嵌入exe内的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆