I'm following JavaFX documentation, but I think it is not updated for the latest version of their IDE. I'm using IntelliJ IDEA 2023.1 (latest), but tutorial is written for IntelliJ IDEA 2020.1 .
I'm trying to run the non-modular project for the first time, and here's what I did:
- Downloaded JavaFX SDK v20 for Win X64, and extracted the zip file
- Created new JavaFX project, and didn't check for any additional libraries when prompted in the following window IntelliJ IDEA new JavaFX project
- Added JavaFX library via "Project Structure"
I'm stuck on step four, where I'm supposed to add VM options. I go to Run -> Edit Configurations
, but my window is completely different than the one showed in the documentation, and I do not know where I'm supposed to enter the command --module-path "\path\to\javafx-sdk-20\lib" --add-modules javafx.controls,javafx.fxml
.
Inside Run/Debug Configurations
window, I did +
→ Application
, inside box for main class I selected com.example.demo.HelloApplication
, and inside box for program arguments I put --module-path "\path\to\javafx-sdk-20\lib" --add-modules javafx.controls,javafx.fxml
, where I did put my path to javafx lib dir.
When I tried to run my HelloApplication.java
, I get the error java: module not found: javafx.controls
, even though it's included as a parameter in the above mentioned command, i.e. part --add-modules javafx.controls,javafx.fxml
.
I also followed documentation from JetBrains, which is up to date, and I still got the same error, i..e that modules are not found: IntelliJ IDEA error output