javafx-gradle-plugin icon indicating copy to clipboard operation
javafx-gradle-plugin copied to clipboard

[Modular][SDK] Multiple JavaFX jars on module path

Open abhinayagarwal opened this issue 5 years ago • 3 comments

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:

  1. JavaFX SDK
  2. As a transitive dependency from ControlsFX

abhinayagarwal avatar Feb 18 '20 11:02 abhinayagarwal

@abhinayagarwal You should be able to use the Gradle exclude method nested below the compile method that declares the controlsfx dependency.

msgilligan avatar Feb 21 '20 20:02 msgilligan

Possible same as #65

falkoschumann avatar Jan 04 '21 18:01 falkoschumann

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.

Siedlerchr avatar Oct 05 '21 19:10 Siedlerchr