Java: embedding jar inside 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
Bu开发者_开发知识库t 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?
Use JSmooth. We use it with much success
There is a tool called Jar2Exe. I don't know if it's the same tool that Minecraft uses however.
Launch4j is another tool that supports this (with quite a few extra features such as auto-downloading a JRE if necessary).
精彩评论