4

I'm exploring the modularity of Java 9+ and I'm stuck with adding JavaFX. I'm using IntelliJ and OpenJDK11 but IntelliJ can't seem to find JavaFX even though I have added the library and added the deps in the module-info.

enter image description here

Naman
  • 27,789
  • 26
  • 218
  • 353
M. Malkon
  • 145
  • 1
  • 6
  • 1
    AFAIK OpenJDK does not have JavaFX, it is a separate project OpenJFX. – m0skit0 Oct 10 '18 at 17:08
  • 1
    I know that's why I added JavaFX seperately. – M. Malkon Oct 10 '18 at 17:13
  • was [this answer](https://stackoverflow.com/questions/52467561/intellij-cant-recognize-javafx-11-with-openjdk-11/52470141#52470141) not helpful as well? – Naman Oct 10 '18 at 17:48
  • isn't that the "old way" of doing it? I want to make use of jlink and the new modular system. I think this requires a module-info.java if I'm not mistaken. – M. Malkon Oct 10 '18 at 18:21
  • This is issue of Intellij's version so check out this https://intellij-support.jetbrains.com/hc/en-us/requests/1901571 –  Dec 12 '18 at 10:25
  • I would configure Gradle to use javafx dependencies from the Maven Central: https://mvnrepository.com/artifact/org.openjfx – Ruraj Jan 27 '20 at 19:52

1 Answers1

1

Right click on the library > Add to Modules... > Choose the module which requires it

libraries settings

Antoine Snyers
  • 682
  • 3
  • 7
  • 1
    That is not the Gradle way to go. With Gradle, if you refresh the project, it will overwrite the manual project settings. – Sometowngeek Jun 01 '21 at 11:35