module-system-woes
module-system-woes copied to clipboard
Explore how modules interact with JavaFX
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
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.