r/java • u/SeAuBitcH • Jan 19 '26
I've made an .jar to native executable packager and want feedback
github.comHello everyone. As said in the title, I've crafted a handy tool which lets you package a .jar into a self contained native executable for Windows, Linux and MacOS, and I'm looking for feedback. This is more of a Proof of Concept than a concrete, production ready tool, so I'm really looking forward on feedback on what could I add, or how I could do things better. it is currently 160 lines of C# and has lots of room for improvement.
Here is how it works under the hood (shortly):
the script generates a "runtime" c# file with the JAR and JRE in it as a b64 byte[] variable which is decompressed at runtime in temp and runs it. the good sides of this approach is that this gives a self contained executable which does not need the end user to have java (nor .NET) installed on their computer. the downside is the size of the final executable (250mb for a 5mb jar and a 60mb JRE.)
thank you for reading this, and here is the github repo: https://github.com/legeriergeek/JNatPack
(PS: Sorry for the long post and any awkward sentences, English isn’t my first language.)
(PS 2: I'm truly sorry if this post is not appropriate in this sub)
