简体   繁体   中英

How to add JavaFX to maven-based project in NetBeans

I opened a project in NetBeans, it is a Maven-based project and i have a problem with javafx imports. There is a communique fe: "package javafx.animation does not exist".

Normally when I create a new JavaFX projekt I select the Java with Ant > Java Aplication and then when I right click on my project on the projects list I choose Properties and in the Libraries section I can add JavaFX library.

In this case, when I open maven-based project there is not Libraries section in the properties and I don't know how to add the JavaFX library?

Instructions for using JavaFX with Maven and Gradle-based projects are found here:

https://openjfx.io/openjfx-docs/

I suspect you are running on a JDK that does not have JavaFX modules included. That is normal. However, there are some builds of OpenJDK that include the JavaFX modules so you don't have to add them manually. Using such a JDK may make things easier. Consider one of the OpenJDK builds from Azul or Bellsoft that includes JavaFX.

For Bellsoft choose the "Full JDK": https://bell-sw.com/pages/downloads/

For Azul choose "JDK FX" as the "package": https://www.azul.com/downloads/zulu-community/?package=jdk

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM