--Generate a fat jar that contains all the OpenJFX 11 libraries for each platform.
JavaFX is a cross-platform GUI library that runs on the JVM. However, from Java 11, the library is no longer included, and instead it has been made into an external library as OpenJFX.
The problem here is "Which Java version do you support?" I want to support Java 11, but I can't easily truncate Java 8 (Free Oracle updates for individual users will continue until the end of 2020 java / eol-135779-ja.html)).
The solution to this problem is fat jar, which simply includes all the OpenJFX 11 libraries in the jar file.
Details can be found in Getting Started with JavaFX 11> Runtime images> Non-Modular project, but with Gradle (for normal jar task settings) In addition) add the following specifications.
build.gradle
compileOnly "org.openjfx:javafx-graphics:$javafx.version:win"
compileOnly "org.openjfx:javafx-graphics:$javafx.version:linux"
compileOnly "org.openjfx:javafx-graphics:$javafx.version:mac"
And if you build with JDK11, you will have a fat jar that works with both Java8 / 11.
Recommended Posts