Hi, Jeff,
Thanks for your answers and welcome to the Jar HellJ.
Let’s describe your situation. You have two jars: 1) your “main” jar that contains (besides .class files and resources) manifest.mf file with the line “Main-Class: xxx” pointing to your main class; 2) Aspose.Words jar that contains its own manifest file (without “Main-Class: xxx” line since Aspose.Words is library but with great number of another important lines since the jar is signed). Note that Aspose.Words jar also contains the blacklist file in resources folder and at last the jar is signed. So you got a zugzwang: if you modifying anyway Aspose.Words jar – it won’t work, if you modifying your jar’s manifest (change it with Aspose.Words’s one) – java can’t find the main class for your application.
You have at least four options to solve the problem:
- Do not include all jars into oneJ. The best option, imo, since jarring one jar into another jar is non-standard way (see https://docs.oracle.com/javase/tutorial/deployment/jar/downman.html ). This option will help you to save a lot of time during deployment and, especially, during maintenance.
- Manually implant one jar into another using zip and notepad (for editing a manifest). Probably what you doing by now (?). – It is possible, but doesn’t practically feasible, imo, especially in maintenance period.
- Obfuscate one jar into another. By the way, this option used when we compose Aspose.Words jar – this helps to make the jar such a small and raises the performance (we leaving on top only license files). But most of current obfuscators can’t work with non .class files and we do not obfuscate some external libraries (with dependences on non .class configuration files) into Aspose.Words jar. This option doesn’t suit for you too because Aspose.Words jar contains dependence to blacklist xml file.
- Try to use One-JAR tool (http://one-jar.sourceforge.net/ ). I don’t test it but they stated that the tool can help to include one jar into another jar without any change to the first one.
So, you really have only two options – ## 1 and 4. And if you will have success with option #4 don’t forget to leave Aspose.Words license.txt file on top level.
Regards,