I'm working on a JavaFX project, I started using Netbeans having no problems then switched to IntelliJ Idea where I'm having troubles. At first, some imports like java.sql and javafx were not working, so I added a module-info.java file to the src folder where I put all the required imports, like this:
module blood {
requires javafx.fxml;
requires javafx.controls;
requires javafx.graphics;
requires java.sql;
requires java.desktop;
requires jdk.jfr;
opens sample;
}
The module has the same name as the project "blood". Now i have no errors concerning the imports but when i run my project i'm getting this:
"C:\Program Files\Java\jdk-11.0.2\bin\java.exe" --module-path C:\Users\USER\Downloads\javafx-sdk-11.0.2\lib --add-modules=javafx.controls,javafx.graphics,javafx.fxml --add-modules javafx.base,javafx.graphics --add-reads javafx.base=ALL-UNNAMED --add-reads javafx.graphics=ALL-UNNAMED -Djava.library.path=C:\Users\USER\Downloads\javafx-sdk-11.0.2 "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2019.3.4\lib\idea_rt.jar=50526:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2019.3.4\bin" -Dfile.encoding=UTF-8 -m blood/sample.Main
Error occurred during initialization of boot layer
java.lang.module.FindException: Module blood not found
Process finished with exit code 1
I also added to the VM options this line:
--module-path "C:\Users\USER\Downloads\javafx-sdk-11.0.2\lib" --add-modules=javafx.controls,javafx.graphics,javafx.fxml
What should i do?