r/java • • Jan 02 '25

How Java's Executable Assembly Jars Work

https://mill-build.org/blog/5-executable-jars.html
64 Upvotes

42 comments sorted by

View all comments

Show parent comment

2

u/skippingstone Jan 02 '25

What is the zip hack script?

5

u/Ok-Scheme-913 Jan 03 '25

Read the blog post. TLDR: A zip file has a "table of content" at the very end, and has relative references from there. So you can prepend anything at the beginning of a zip file, to e.g. make it simultaneously a valid .exe/.sh/whatever file.