简体   繁体   中英

Launch4J - main jar, all dependencies into one exe

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

Thanks.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM