IntelliJ can't recognize JavaFX 11 with OpenJDK 11

前端 未结 4 2133
星月不相逢
星月不相逢 2020-11-22 01:57

I\'m having trouble getting IntellJ to recognize JavaFX packages. With a new JavaFX project, with OpenJDK 11, when trying to build the project, IntelliJ can\'t recognize the

4条回答
  •  悲哀的现实
    2020-11-22 02:31

    None of the above worked for me. I spent too much time clearing other errors that came up. I found this to be the easiest and the best way.

    This works for getting JavaFx on Jdk 11, 12 & on OpenJdk12 too!

    • The Video shows you the JavaFx Sdk download
    • How to set it as a Global Library
    • Set the module-info.java (i prefer the bottom one)

    module thisIsTheNameOfYourProject {
        requires javafx.fxml;
        requires javafx.controls;
        requires javafx.graphics;
        opens sample;
    }
    

    The entire thing took me only 5mins !!!

提交回复
热议问题