Hi! Thanks for reading the article.
In fact I did figure out a way of bundling the JRE.
The idea is bundling up a stripped-down JRE. There're too many Java accesories we don't really need. For this, and considering server.jar as our Java app:
1. Get what you need. This command may vary depending on what Java version you're using: jdeps -q --recursive --multi-release 11 --print-module-deps --class-path 'lib/*' server.jar
2. Generate the stripped-down JRE: jlink --no-header-files --no-man-pages --compress 2 --strip-debug --add-modules java.base,java.sql --output java-runtime
The modules in the parameter are the result of the previous command. After that you'll have to adjust the command and include the whole new java-runtime folder in your distributable bundle. But hey! 30M is nothing compared to the 200M normal JRE, and no need to install it separately.
For more information look for the documentation for jdeps and jlink. Both commands are supposed to be installed with the JDK.
Hope it helps!