How to convert a normal java project in intellij into a JavaFx project

后端 未结 5 1982
攒了一身酷
攒了一身酷 2020-11-29 07:35

I am currently using a normal java project (gradle project) and want to convert this into a JavaFx project without having to reimport the existing sources into a new Javafx

5条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-29 08:21

    So after lots of googling I finally found it out myself!

    If you can create new Javafx projects in Intellijd and it works perfectly, but when you open a normal java application that happens to use javafx doesn't work, (because java just doesn't want to resolve the javafx references)

    what works for me is this: You must add the "jre/lib/ext/jfxrt.jar" file to the module classpath that is located inside IDEA on my windows machine this is C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2018.3.3\jre64\lib\ext\jfxrt.jar.

    And now it finally builds!

提交回复
热议问题