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.
27 Replies
⌛
This post has been reserved for your question.
Hey @AbuAbed! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./close
or theClose 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.
Can you show your pom.xml?
what would the path be?
in the project folder?
Are you using Maven?
How did you create the project?
I am using NetBeans as mentioned in the title
yes but how did you create the project in NetBeans?
In my experience, people mostly use Maven with NetBeans
I used the normal procedures
By creating a JavaFX Application project
💤
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.
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
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
There is no download
JavaFX 8 is part of Java 8 in some JDKs
but not all
Should I try installing it for netbeans?
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)
It's what I'm using right now
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
but you are probably best off just using Maven, especially in NetBeans
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
see the "Maven" section in that tutorial
Alright I will try with maven and come back to you
I'd recommend using the "Modular with Maven" section
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
@dan1st
The method signature is
public void start(Stage stage) {
so here you are calling it stage
and not primaryStage
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
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.
Post Closed
This post has been closed by <@299947216641064960>.