2

I have switched to OpenJDK 11 and for some reason it doesn't include JavaFX, so I have to use it as a dependency now. However, SBT imports an empty jar.

enter image description here

enter image description here

Just curios why it may happen and how to fix?

Gayan Mettananda
  • 1,498
  • 14
  • 21
Sergii Sopin
  • 411
  • 2
  • 11
  • You likely need to include the platform-specific classifier of the dependency (i.e. `win` for Windows, `linux` for Linux, etc...). Unfortunately, I don't know how to do that with SBT. Gradle has a similar problem though Maven handles this automatically. The reason for these classifiers is because certain JavaFX modules include platform-specific native code. – Slaw Dec 13 '18 at 05:00
  • It seems you are right. Maven central contains different versions: http://central.maven.org/maven2/org/openjfx/javafx-base/12-ea+4/. It is super weird... Thanks. – Sergii Sopin Dec 13 '18 at 05:09
  • 2
    It's not so weird when you realize why they've done it this way. See [this answer](https://stackoverflow.com/a/52605335/6395627) and [this mailing list](https://mail.openjdk.java.net/pipermail/openjfx-dev/2018-April/021762.html) for more information. – Slaw Dec 13 '18 at 06:39

1 Answers1

1

In order to get proper jar you need to add OS classifier. For instance: "org.openjfx" % "javafx-base" % "12-ea+4" classifier "linux". Or you can follow the example: https://www.reddit.com/r/scala/comments/9fbzbk/build_file_snippet_for_using_javafx_with_java_11/

Sergii Sopin
  • 411
  • 2
  • 11