-
Notifications
You must be signed in to change notification settings - Fork 171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not compatible with Capsule.io jars but with Workaround #69
Comments
Out of interest, what happens if you unpack and repack your JAR manually, using 7zip? Does it still run afterwards? |
Extracting and then creating the known-working jar with 7zip did not work. I tried all compression levels from Store to Ultra with no successful result, Here's my environment:
|
I do not know how Capsule works, but this sounds like this is creating some non-trivial JAR archive. My only idea so far is to add a packr option to opt out of the step of un-/re-packing the JAR. This is only done right now to delete native libraries not matching the target platform. |
I think that would be a valid option. |
Capsule uses System.exit() when the wrapped program terminates. This may be reason for the abrupt termination you notice here. Please have a look at puniverse/capsule#107 for more details. |
Packr shouldn't repackage your JAR file unless you specified removelibs, e.g. |
Summary: packr appears to extract/recompress the Capsule fat jar in the classPath and it no longer loads. Replacing the generated output jar with the original will return the Capsule functionality and the generated native executable is able to run it.
Tested environment:
My current build process has Capsule build a fat jar to include all dependencies including the signed BouncyCastle provider. When I use packr on this jar file, it appears to modify the capsule.jar such that it no longer runs with
java -jar name_of_capsule.jar
. Here are the steps to recreate with a known good capsule.jar file (in this exampleecc-tester-java-0.1-SNAPSHOT-capsule.jar
)Changing into the output directly, run the generated exe. Since there is no console log on windows send to log (native.exe > log) and see that it exits immediatly after invoking the Capsule class:
Attempt to run the output jar file exhibits the same behavior - it simply exits
Now I replaced that jar file with the original/source capsule jar to do a sanity check
Now that the jar is working again, retest the generated exe (but still no console output, have to send to a log (native.exe > log))
Final note: The original capsule jar file and the packr output jar file have binary diffs but extracting them (using 7zip) shows no internal differences.
The text was updated successfully, but these errors were encountered: