by zmmmmm · 3y ago · 0 comments
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?The “unzip” utility can be useful as a sanity check; run “unzip -t” to test the integrity of the file.
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/scri...This is what the (now defunkt) Capsule project prepends to get this same effect