Search code examples
mavendeploymentjavafxjvm-arguments

How do I deploy an app with javafx keyboard?


I've build an app using javafx. It was developed to use with a touch screen. In my vm I specified the following arguments:

-Dcom.sun.javafx.isEmbedded=true -Dcom.sun.javafx.touch=true -Dcom.sun.javafx.virtualKeyboard=javafx

With this arguments when I select some kind of data input the javafx digital keyboard pops up.

Now I want to deploy the app with the same arguments using maven. How can I do that?

I've tried with the following pom definitions (suggested by ItachiUchia) but with no luck:

<plugin>
                <groupId>com.zenjava</groupId>
                <artifactId>javafx-maven-plugin</artifactId>
                <version>8.1.2</version>
                <configuration>
                    <mainClass>com.mycompany.app_name.Main</mainClass>
                    <jvmArgs>
                        <argument>-Dcom.sun.javafx.isEmbedded=true</argument>
                        <argument>-Dcom.sun.javafx.touch=true</argument>
                        <argument>-Dcom.sun.javafx.virtualKeyboard=javafx</argument>
                    </jvmArgs>
                </configuration>
            </plugin>

Thank you


Solution

  • You can pass the JVM args using the jvmArgs in the configuration of the javafx-maven-plugin. A simple example :

    <configuration>
        <jvmArgs>
            <argument>-Dcom.sun.javafx.isEmbedded=true</argument>
            <argument>-Dcom.sun.javafx.touch=true</argument>
            <argument>-Dcom.sun.javafx.virtualKeyboard=javafx</argument>
        </jvmArgs>
    </configuration>