module-system-woes icon indicating copy to clipboard operation
module-system-woes copied to clipboard

Explore how modules interact with JavaFX

Open nipafx opened this issue 4 years ago • 1 comments

Some related links:

  • https://andresalmiray.com/building-a-layered-modular-java-application-watch-out-for-these/
  • exception swallowed by JavaFX classes?
    • https://twitter.com/lanthale/status/1405776799724806144
  • https://github.com/javafxports/openjdk-jfx/issues/236#issuecomment-426583174
  • resources, e.g. FXML, CSS

nipafx avatar Nov 05 '21 15:11 nipafx

Some additions:

There is a JavaFX Plugin that configures the JavaFX dependencies without the need to manually specify dependencies and configuration. However, it's not working properly with modules, apparently since it still thinks gradle doesn't know how to handle modules:

  • https://github.com/openjfx/javafx-gradle-plugin/issues/94
  • https://github.com/openjfx/javafx-gradle-plugin/issues/133

You need to specify the dependencies manually. If you use the FXML module, because it uses reflection, you also need to open it.

Another point is that JavaFX modules are platform-specific and use a classifier. For example

"org.openjfx:javafx-graphics:$javafxVersion:win"

will download the graphics module for windows. To create a cross-platform application, you need to specify the other platform dependencies too.

nlisker avatar Jul 30 '23 00:07 nlisker