1

I am working on a JavaFX project using Maven which requires the JavaFX on screen keyboard enabled. I am trying to achieve this by using the following JVM options.

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

The corresponding POM sections are as fololows.

<!-- Property Definitions -->
<properties>
    <jvm.options>-Dcom.sun.javafx.isEmbedded=true -Dcom.sun.javafx.virtualKeyboard=javafx</jvm.options>
</properties>

<!-- Compiler Plugin -->
<plugin>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>3.7.0</version>
    <configuration>
        <source>1.8</source>
        <target>1.8</target>
        <compilerArgs>
            <compilerArg>${jvm.options}</compilerArg>
        </compilerArgs>
    </configuration>
</plugin>

The source results in a maven build failure with the following error.

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.633 s
[INFO] Finished at: 2018-01-12T20:58:27+05:30
[INFO] Final Memory: 9M/153M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project pos: Fatal error compiling: invalid flag: -Dcom.sun.javafx.isEmbedded=true -Dcom.sun.javafx.virtualKeyboard=javafx -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.

The flags work with the eclipse build tool (Run as -> Java Application). What have I been doing wrong? Is there any documentation on how to to set those two flags using Maven? Any help is much appreciated.

Saminda Peramuna
  • 735
  • 9
  • 22

0 Answers0