0

I wrote

// https://mvnrepository.com/artifact/org.openjfx/javafx-base
implementation group: 'org.openjfx', name: 'javafx-base', version: '17.0.1'

in my geadle file and got empty jar. On jars page I see, that generic jar is really empty, while platform specific are not.

How should I describe my dependency here then?


Next I wrote

plugins {
    id 'org.openjfx.javafxplugin' version '0.0.10'
}

javafx {
    version = "17"
    modules = [ 'javafx.base' ]
}

but this didn't help

Dims
  • 47,675
  • 117
  • 331
  • 600
  • 1
    The javafx 17 modules in maven central (used by gradle) are broken, try using [javafx 17.0.1](https://stackoverflow.com/a/69137635/1155209). – jewelsea Dec 13 '21 at 21:07
  • All of the implementation is packed into the platform specific jars which will (if everything works correctly) also be downloaded and used for your environment without you having to specify anything else (at least maven works that way, I don't use gradle, but I believe it will be the same). The non-platform specific jars are very small because they contain no implementation, it is just how the JavaFX team chose to package the maven artifacts. – jewelsea Dec 13 '21 at 21:08
  • @jewelsea is doesn't download. Why would it? – Dims Dec 13 '21 at 21:22
  • 1
    I don't know how the mechanism works, I just know that it works, at least if you use Maven, and I am sure Gradle is not different in that respect. You can see the [javafx-base artifacts here](https://repo1.maven.org/maven2/org/openjfx/javafx-base/17.0.1/), javafx-base-17.0.1.jar is only 302 bytes. javafx-base-17.0.1-win.jar is 746018 bytes. Without the platform specific jars you don't have an implementation. – jewelsea Dec 13 '21 at 21:26
  • I checked it out to see how it works, it's pretty simple, the platform specific artifact is a dependency of the the non-platform specific artifact. See the [pom.xml](https://repo1.maven.org/maven2/org/openjfx/javafx-base/17.0.1/javafx-base-17.0.1.pom). Fetching transitive dependencies is something both maven and gradle will do by default. – jewelsea Dec 13 '21 at 21:29
  • 1
    Hm, it really worked. May be 17-th was really broken... – Dims Dec 13 '21 at 21:30
  • Yes, it really is . . . – jewelsea Dec 13 '21 at 21:31

0 Answers0