I am currently working on a game engine for Java, with compile targets for windows, macos, linux, android and the web. Now I have a question about deploying to windows, macos and linux.
My original plan was to use packr (An application that takes a JAR-file and any JRE and creates a binary) and a copy of the Amazon Corretto JRE to create the binaries. My problem with this is the file size: A simple "Hello, World" on Windows already requires ~100MB disk space...
I would really like to include the JRE inside the application (so no wrapper that downloads the JRE if needed). Is there maybe some JRE out there that is optimized for smallest code size or maybe some way to generate one according to my dependencies?
Thanks to nur1, I have now figured out a solution. Using OpenJDK version 11, I can build my Program, use jdeps to figure out what parts of the default JRE my application needs and create a custom JRE that only includes the required classes. The whole process is also described here.
A custom JRE configured for a simple "Hello, World!" now takes up ~25MB, which I can definitely live with.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With