Unable to build a JavaFX code on NetBeans 17

I have installed and used JavaFX 21 on NetBeans 17 and wrote simple coding to build an interface. I ran the program but gave me an error saying that the program failed to build. My initial thought was that the versions are included in JavaFX 21 but I have my doubts. Someone recommended that I work with JavaFX 8 but I couldn't find a source to download it from. Either helping me to solve the error or to install JavaFX 8 would be appreciated.
No description
27 Replies
JavaBot
JavaBot2mo ago
This post has been reserved for your question.
Hey @AbuAbed! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
dan1st
dan1st2mo ago
Can you show your pom.xml?
AbuAbed
AbuAbedOP2mo ago
what would the path be? in the project folder?
dan1st
dan1st2mo ago
Are you using Maven? How did you create the project?
AbuAbed
AbuAbedOP2mo ago
I am using NetBeans as mentioned in the title
dan1st
dan1st2mo ago
yes but how did you create the project in NetBeans? In my experience, people mostly use Maven with NetBeans
AbuAbed
AbuAbedOP2mo ago
I used the normal procedures By creating a JavaFX Application project
JavaBot
JavaBot2mo ago
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one. In case your post is not getting any attention, you can try to use /help ping. Warning: abusing this will result in moderative actions taken against you.
dan1st
dan1st2mo ago
Can you show the project files? Did it let you select a JavaFX version? I think the "JavaFX Application project" might be for Java 8 so you'd probably need something else
AbuAbed
AbuAbedOP2mo ago
For the project I'm working on, some APIs that I need to use require JavaFX 8 but I can't find a source to download that
dan1st
dan1st2mo ago
There is no download JavaFX 8 is part of Java 8 in some JDKs but not all
AbuAbed
AbuAbedOP2mo ago
Should I try installing it for netbeans?
dan1st
dan1st2mo ago
So if you want to use JavaFX 8, you can only use it on some Java 8 installations it's probably better to use JavaFX 21 or similar (e.g. JavaFX 23)
AbuAbed
AbuAbedOP2mo ago
It's what I'm using right now
dan1st
dan1st2mo ago
https://openjfx.io/openjfx-docs/#IDE-NetBeans should have instructions on how to use it
Getting Started with JavaFX
Getting started with JavaFX for Java desktop application development
dan1st
dan1st2mo ago
but you are probably best off just using Maven, especially in NetBeans
AbuAbed
AbuAbedOP2mo ago
On the screenshot that I sent, it said that the "JavaFX deployment library is not found". I assume the 'deployment' phrase refers to opening the window for the code
dan1st
dan1st2mo ago
see the "Maven" section in that tutorial
AbuAbed
AbuAbedOP2mo ago
Alright I will try with maven and come back to you
dan1st
dan1st2mo ago
I'd recommend using the "Modular with Maven" section
No description
AbuAbed
AbuAbedOP2mo ago
Okay, I created a Maven project but now the 'primaryStage' constructor is not recognized I just copy pasted my code in the new project I will send a copy of my code here
AbuAbed
AbuAbedOP2mo ago
AbuAbed
AbuAbedOP2mo ago
@dan1st
dan1st
dan1st2mo ago
The method signature is public void start(Stage stage) { so here you are calling it stage and not primaryStage
AbuAbed
AbuAbedOP2mo ago
Oh wow it all works now I guess I will use Maven from now on JavaFX Shenanigans I guess Apart from some syntax I think I can manage to work on this Thanks for your help
JavaBot
JavaBot2mo ago
If you are finished with your post, please close it. If you are not, please ignore this message. Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.
JavaBot
JavaBot2mo ago
Post Closed
This post has been closed by <@299947216641064960>.

Did you find this page helpful?