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/agentoutlier Jan 03 '25

I encourage you to explore what an uber jar and jlink application is and how this is all just packaging.

With what I’m recommending your packaging could be a docker image I rather superior packaging format over several alternatives.

Even with the actual true one file of exe (which is not uber jar but graalvm native) you now have the permutations of platforms but worse than docker as you have os and arch. (Docker its just arch and the registry makes it easy for users to get the right one instead of some list of zip/exe downloads on a release page).

An uber image is probably the worse packaging as the JDK is not designed for it. It breaks encapsulation and does not include the JDK.