justme_
justme_

Reputation: 665

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

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?

Upvotes: 2

Views: 3022

Answers (3)

Joachim Sauer
Joachim Sauer

Reputation: 308041

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

Upvotes: 0

jonescb
jonescb

Reputation: 22771

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

Upvotes: 1

user489041
user489041

Reputation: 28304

Use JSmooth. We use it with much success

Upvotes: 2

Related Questions