I try to use Capsule to generate an executable jar with all dependencies included (alternative to uberjar). But the result jar file doesn't run and quit immediately.
Platform (macOS, Linux, Windows): macOS
Platform version: HIgh Sierra 10.13.2
JRE/JDK version (java -version): 1.8.0
Boot details
Boot version (2.7.1): 2.6.0
build.boot present? (yes/no): yes
~/.boot/profile present? (yes/no): no
Task name? (if applicable): capsule
The cause
When Capsule.class starts, it uses JarInputStream.getManifest() to read MANIFEST.MF in the capsuled jar. JarInputStream assumes manifest is the first jar entry. However "jar" task (and finally boot.jar/update-jar!) writes MANIFEST.MF to the last entry, so getManifest() returns null.
After MANIFEST.MF is written first, the capsuled jar runs.
Problem Description
I try to use Capsule to generate an executable jar with all dependencies included (alternative to uberjar). But the result jar file doesn't run and quit immediately.
Steps to reproduce
This is capule task definition in
build.boot
:Platform details
Platform (macOS, Linux, Windows): macOS Platform version: HIgh Sierra 10.13.2 JRE/JDK version (
java -version
): 1.8.0Boot details
Boot version (2.7.1): 2.6.0
build.boot
present? (yes/no): yes~/.boot/profile
present? (yes/no): no Task name? (if applicable): capsuleThe cause
When Capsule.class starts, it uses JarInputStream.getManifest() to read MANIFEST.MF in the capsuled jar. JarInputStream assumes manifest is the first jar entry. However "jar" task (and finally boot.jar/update-jar!) writes MANIFEST.MF to the last entry, so getManifest() returns null.
After MANIFEST.MF is written first, the capsuled jar runs.