Reducing the size of my JavaFX application

I am writing an application with JavaFX, and I am concerned about the size of the .EXE file that I will initially deploy. The application that I have is not so great (collectively less than 5M), but the Java Runtime makes the final installed directory more than 100M, which is compressed into a ditributable 44M file.

I ran tests with 64-bit Windows (Java SE 8u77). To reduce the final executable, I removed parts of the JRE that are not needed, as described here: http://www.oracle.com/technetwork/java/javase/jre-8-readme-2095710.html

Here is what I found:

  • Full JRE: 45.0 M
  • Stripped JRE: 44.0 M

Does anyone have any ideas on how to make the .EXE distribution even smaller? All the information I found is at least 2 or 3 years old and may not be as relevant. I feel there is more that can exit the JRE, but it looks like it will violate the licensing.

Does anyone have experience using any non-Oracle distributions or any other ways to make a JavaFX application smaller?

+4
source share
2 answers

When using javapackager you can install NOT NOT JRE. This allows you to use a locally installed JRE (which may not be the best solution).

When using javafx-maven-plugin you just need to set the bundlerArgument parameter:

<configuration>
    <mainClass>com.zenjava.test.Main</mainClass>
    <bundleArguments>
        <runtime /> <!-- dont include JRE, use installed one -->
    </bundleArguments>
</configuration>

javafx- gradle -plugin NULL:

jfx {
    verbose = true
    mainClass = 'your.application.appname'
    appName = 'appname'
    jfxMainAppJarName = 'appname.jar'
    vendor = "My Company"
    bundleArguments = [
        runtime: null
    ]
}

ant -style xml javapacker :

<fx:bundleArgument name="runtime" value="" />

: javafx-maven-plugin javafx-gradle-plugin.

+3
-2

All Articles