5 ms·
this sounds incredibly useful but I couldn't get it to work. I just get java.util.zip.ZipException: invalid CEN header (bad signature) at java.base
by zmmmmm 3y ago
this sounds incredibly useful but I couldn't get it to work. I just get
java.util.zip.ZipException: invalid CEN header (bad signature)
at java.base/java.util.zip.ZipFile$Source.zerror(ZipFile.java:1623)
if I try to do anything with a JAR file that has leading text. I'm creating it just using
echo 'java -jar $0' | cat - test.jar > test.run.jar
Is there more to it?
- SeanA208 3y agohttps://github.com/puniverse/capsule/blob/master/capsule-util/src/main/resources/capsule/execheader.sh https://github.com/puniverse/capsule/blob/master/capsule-uti... This is what the (now defunkt) Capsule project prepends to get this same effect
- nneonneo 3y agoTechnically, you should update the offset to the central directory in the Zip footer, along with the offsets to each file header in each central directory entry. If you don’t, the zip file reader has to apply some heuristics to locate the central directory; not all readers implement these heuristics, and those that do won’t always be robust. The “unzip” utility can be useful as a sanity check; run “unzip -t” to test the integrity of the file.
- mbreese 3y agoDid you add a shebang line? I have a small bash stub that I use. It’s roughly (I also add JAVA_OPTS, etc…): #!/bin/bash java -jar $0 Then… cat stub.sh myproject.jar > myexec See: https://github.com/compgen-io/ngsutilsj/blob/master/src/scripts/stub.sh https://github.com/compgen-io/ngsutilsj/blob/master/src/scri...