Java: embedding jar inside exe

爱⌒轻易说出口 提交于 2019-12-07 21:10:46

问题


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

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

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


回答1:


Use JSmooth. We use it with much success




回答2:


There is a tool called Jar2Exe. I don't know if it's the same tool that Minecraft uses however.




回答3:


Launch4j is another tool that supports this (with quite a few extra features such as auto-downloading a JRE if necessary).



来源:https://stackoverflow.com/questions/5913120/java-embedding-jar-inside-exe

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!