Migrate from old Swing/AWT API to JavaFX.
References
Modular / Non-modular (Java 9+)
Non-modular application
Since Java 9, applications should be modular, and distributed with tools like jlink. However, if you have a non-modular JavaFX project or you can't use jlink because you have non-modular dependencies where the automatic module naming convention doesn't apply, you can still create a fat jar.
Platform-specific JavaFX libraries
There are platform-specific libraries for JavaFX.
For example for org.openjfx:javafx-controls, we will find :
org.openjfx:javafx-controls:win for Windows
org.openjfx:javafx-controls:mac for Mac OS X
org.openjfx:javafx-controls:linux for Linux x64
- and plenty of variants...
The Maven property javafx.platform defines the artifacts picked.
See details here : https://repo1.maven.org/maven2/org/openjfx/javafx/21/javafx-21.pom
Cross-platform fat jar can be built as shown here : https://github.com/openjfx/samples/blob/master/CommandLine/Non-modular/Maven/hellofx/pom.xml
In that case, libraries for (win+mac+linux) can be packed together.
Migrate from old Swing/AWT API to JavaFX.
References
Modular / Non-modular (Java 9+)
Platform-specific JavaFX libraries
There are platform-specific libraries for JavaFX.
For example for
org.openjfx:javafx-controls, we will find :org.openjfx:javafx-controls:winfor Windowsorg.openjfx:javafx-controls:macfor Mac OS Xorg.openjfx:javafx-controls:linuxfor Linux x64The Maven property
javafx.platformdefines the artifacts picked.See details here : https://repo1.maven.org/maven2/org/openjfx/javafx/21/javafx-21.pom
Cross-platform fat jar can be built as shown here : https://github.com/openjfx/samples/blob/master/CommandLine/Non-modular/Maven/hellofx/pom.xml
In that case, libraries for (win+mac+linux) can be packed together.