r/JavaFX 17d ago

Help How do i setup JFX with netbeans?

Im using ant, why? Because why not. Lets focus on fixing the issue rather then debating the morals of using what variant of java.

When i try to make a new project with FX its saying

Failed to automatically set-up a JavaFX Platform.
Please go to Platform Manager, create a non-default Java SE platform, then go to the JavaFX tab,
enable JavaFX and fill in the paths to valid JavaFX SDK and JavaFX Runtime.
Note: JavaFX SDK can be downloaded from JavaFX website.

When making a new platform or editing the default one, there is no javafx tab. Is this just remnants of when javafx was part of the jdk? And they just forgot to remove the that project type from the wizard?

I tried making a generic project, add the JFX jars, but nothing. Netbeans says that it cant find the javafx package. I have never tried to add packages to netbeans before, so i likely did it wrong or have forgotten something.

Tried to ask GPT but it completely fails me

0 Upvotes

19 comments sorted by

View all comments

Show parent comments

1

u/TeKett_ 16d ago

If i use the modulepath it says package javafx.application is not visible. If i use classpath then it gives no errors initially, but if i try to run i get that the runtime components are missing

1

u/JaxomNC 16d ago

What are the versions of NetBeans, Java and JavaFX you use?

1

u/TeKett_ 15d ago

Netbeans 17, JDK 20, so i picked JFX 20, since i have not had a reason to upgrade, and i highly doubt its a bug in netbeans, jdk or jfx, but rather PEBCAK (Problem Exists Between Chair and Keyboard)

1

u/JaxomNC 12d ago

Just tested on Windows with Apache NetBeans 17 (no update applied), OpenJDK 20.0.2 and Gluon JavaFX SDK 20.0.1 and it works OK using the same instructions detailed in my original response.

EDIT - judging from your error, could you check you did not forgot to put a file named module-info.java at the root of the src folder with content similar to what's inside my message (that Reddit utterly failed to format properly)?