How to pass JVM arguments to a native JavaFX 2 app

2019-08-04 09:38发布

问题:

I have a JavaFX 2 desktop application. I've used javafx-maven-plugin and Inno Setup to create a native bundle for Windows (.exe installer).

When I install the application on Windows Server 2008, I get an out of memory exception, because of the low heap size.

How can I pass JVM arguments to increase the heap size (-Xmx) in this scenario?

Is there any way to specefy jvm arguments to be called when creating the native bundle with Inno Setup?

回答1:

There is no way to do in via Inno Setup, because it just creates an installer for your application.

However, you can use the jvmArgs for the goal javafx:native. Add them in the configuration tag of the javafx-maven-plugin to set the Xmx, Xms or any other JVM arguments.

<configuration>
    <jvmArgs>
        <argument>-Xmx2g</argument>
        <argument>-Xms256m</argument>
    </jvmArgs>
</configuration>