Issue
i know this may sound like a dumb question, but i really didn't figure a way to it. Every time i create a new JavaFX project in Intellji it loads a simple HelloWorld project in it, how can i make it empty ? (without the need of deleting those .java files every time), and how can i choose to create the project without a building system (as you can see in the picture, i'm always forced to create the project with Maven or Gradle)
Solution
When creating the new project, choose "Java" instead of "JavaFX".
A JavaFX application is just a Java application, so if you don't want the additional things which IntelliJ is doing when you choose to create a JavaFX project (e.g. supplying example code and associating with a build system like Maven or Gradle), you can just choose a basic Java application project from the wizard and it won't do those other things.
See the section in openjfx.io documentation titled "JavaFX and IntelliJ IDEA" for other steps you need to take:
Set the project JDK
- File -> Project Structure -> Project
Create a JavaFX library in Idea
- File -> Project Structure -> Libraries
- Point to the lib folder of the JavaFX SDK.
Add VM options for the module path
Run -> Edit Configurations...
--module-path /path/to/javafx-sdk-15.0.1/lib --add-modules javafx.controls,javafx.fxml
For windows use quotes around the path and
\
rather than/
.Run the project
- Run -> Run...
You might also need to take the actions identified in the accepted answer to:
But that answer was written a while back and setting the resource copy configuration to include JavaFX fxml and css files might not be needed anymore.
Now, you might think that is annoying amount of things to do, and I might agree with you.
Answered By - jewelsea