javafx-gradle-plugin
javafx-gradle-plugin copied to clipboard
[Modular][SDK] Multiple JavaFX jars on module path
Using a combination of JavaFX SDK and dependencies on a modular HelloFX project results in multiple javafx-controls jars on the module path.
For example:
javafx {
sdk = "location-to-javafx-sdk-11"
modules = [ 'javafx.controls', 'javafx.fxml' ]
}
dependencies {
compile 'org.controlsfx:controlsfx:11.0.1';
}
The module path looks like:
--module-path
hellofx/build/classes/java/main;
.m2/repository/org.controlsfx/controlsfx/11.0.1/controlsfx-11.0.1.jar;
javafx-sdk-11/lib/javafx.controls.jar;
javafx-sdk-11/lib/javafx.fxml.jar;
.m2/repository/org/openjfx/11.0.2/javafx-web-11.0.2.jar;
.m2/repository/org/openjfx/javafx-controls/11.0.2/javafx-controls-11.0.2.jar;
.m2/repository/org/openjfx/javafx-swing/11.0.2/javafx-swing-11.0.2.jar;
.m2/repository/org/openjfx/javafx-media/11.0.2/javafx-media-11.0.2.jar;
.m2/repository/org/openjfx/javafx-graphics/11.0.2/javafx-graphics-11.0.2.jar;
.m2/repository/org/openjfx/javafx-base/11.0.2/javafx-base-11.0.2.jar
There are 2 instances of javafx-controls.jar from the following locations:
- JavaFX SDK
- As a transitive dependency from ControlsFX
@abhinayagarwal You should be able to use the Gradle exclude method nested below the compile method that declares the controlsfx dependency.
Possible same as #65
All the years this wasn't a problem with me, but now I encounter the same problem in Eclipse with javafx17. I also tried the newest patch release 17.0.01 and excluded controlsfx but both the normal ones, then the mac and linux specific javafx libs are added.