4

How do I include all the jars into Launch4J so that I can build an exe without any dependencies?

Thanks.

theAnonymous
  • 1,701
  • 2
  • 28
  • 62

1 Answers1

1

I think the trick here is to package all of your class files and all dependencies within a single jar. This means extracting the contents of those dependent jars, and then repackaging them.

The answer to this question appears to be related and might help: Launch4J - how to attach dependent jars to generated exe

I think an entirely manual process is also possible. Compile your class file into a build directory. Open each dependency (jar file) as if it were a plain ZIP, and extract the contents into the directory with your class files. Repeat this for every jar. Now your code and the dependencies sit side by side - package the entire set of files into a single JAR and proceed with the steps needed to package that up with Launch4J.

Community
  • 1
  • 1
trooper
  • 4,444
  • 5
  • 32
  • 32
  • I have tried that, but when I run the edited build.xml as instructed, the corresponding .exe file isn't generated. – theAnonymous Aug 24 '14 at 15:57
  • First try to do this entirely manually. Once you have that working, attempt to automate it with an ant task. My guess is there is some config or environment issue with the Launch4J ant task. – trooper Aug 24 '14 at 16:00
  • OK. I found out that I made a really "noob" mistake and fixed it. Thanks for the help. – theAnonymous Aug 24 '14 at 16:18