I try to run and my application with InteliJ and Maven on a Win 10 machine. If i run
mvn clean javafx:run
My GUI starts but if i use a Textfield from org.controlsfx.control.textfield.TextFields i encounter a problem
Exception in thread "JavaFX Application Thread" java.lang.IllegalAccessError: class org.controlsfx.control.textfield.AutoCompletionBinding (in unnamed module @0x19b440d0) cannot access class com.sun.javafx.event.EventHandlerManager (in module javafx.base) because module javafx.base does not export com.sun.javafx.event to unnamed module @0x19b440d0
i found that this is a know problem and that you have to pass to JVM following command.
--add-exports=javafx.base/com.sun.javafx.event=org.controlsfx.controls
But how i do this in maven? i tried 2 ways.
Way 1: using the .mvn/jvm.config file and add this command but this doesn't change anything at all even if a enter sensless stuff in there.
Way 2: adding a systemvariable MAVEN_OPTS with the --add-export command. Then maven reacts on this change but say:
WARNING: Unknown module: org.controlsfx.controls specified to --add-exports
How i can fix this?
edit: Way 3: according to https://github.com/openjfx/javafx-maven-plugin it should be possible to add to javafx-maven-plugin this --add-export to but InteliJ mark this as invalid that this element can not be used in this place
<plugin>
<groupId>org.openjfx</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>0.0.4</version>
<configuration>
<compilerArgs>
<arg>--add-exports</arg>
<arg>javafx.graphics/com.sun.glass.ui=org.openjfx.hellofx</arg>
</compilerArgs>
<mainClass>org.openjfx.hellofx/org.openjfx.App</mainClass>
</configuration>
</plugin>
https://github.com/openjfx/javafx-maven-plugin/issues/53 seems to be known but not considered as issue