I created a JavaFX application, For it I bundled it As a self-contained standalone application, using a private copy of Java Runtime.
But this became my application's size of 166MB, in which 146 Mb size is for jre.
How can I reduce the size of my application or can say size of bundle Runtime JRE?
I read somewhere that some files are optional in jre, So I tried to run my application after removing those files but unable to run the application.
So how can I remove the unused files/folders/modules from the Runtime JRE for my application ?
It is said that
Only a subset of Java Runtime is included by default. Some optional and rarely used files are excluded to reduce the package size, such as all executables. If you need something that is not included by default, then you need to copy it in as a post-processing step.
So by default it is not adding all the files in jre, in that case my application is not running. Application.jar is working fine as it is using system jar. So I add all the reamaining files in post-processing step.
Thanks
Project Jigsaw appears to have some hope for helping with this.
But it looks to be coming in Java 9 at the earliest.
So as far as I can understand from your post, you can't run your app with the reduced JRE size that JavaFX provides. Additionally, you tried the steps detailed here and you still can't run your app.
Many apps can run just fine with the limited number of classes available in the JavaFX packaging of the JRE. Perhaps you can examine what Java libraries you are using which cause this issue. Then you could explore alternatives to those libraries. Finally you would need to test whether those alternative libraries are larger or smaller than the space reduction provided by the reduction in the JavaFX packaging.
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