I just started coding with IntelliJ and I have been having this problem and cannot fix it. The error is "Error occurred during initialization of boot layer java.lang.module.FindException: Module javafx.controls not found". I've tried multiple times refactoring the code again and again it doesn't seem to work. It shows red lines in my module so I assume that its the problem. Here is the overall code:
module com.example.beluxfx {
requires javafx.controls;
requires javafx.fxml;
requires org.controlsfx.controls;
requires org.kordamp.bootstrapfx.core;
opens com.example.beluxfx to javafx.fxml;
exports com.example.beluxfx;
}
I have also tried getting the configurations in the run tab and confused what it means by "main". I tried going into yt videos and again didn't seem to work. Here is the error code if you need it:
"C:\Program Files\Java\jdk-17\bin\java.exe" --module-path \path\to\javafx-sdk-17\lib --add-modules javafx.controls,javafx.fxml "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2021.2.3\lib\idea_rt.jar=61232:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2021.2.3\bin" -Dfile.encoding=UTF-8 -classpath C:\Users\yozsh\.m2\repository\org\openjfx\javafx-controls\17.0.0.1\javafx-controls-17.0.0.1.jar;C:\Users\yozsh\.m2\repository\org\openjfx\javafx-graphics\17.0.0.1\javafx-graphics-17.0.0.1.jar;C:\Users\yozsh\.m2\repository\org\openjfx\javafx-base\17.0.0.1\javafx-base-17.0.0.1.jar;C:\Users\yozsh\.m2\repository\org\openjfx\javafx-fxml\17.0.0.1\javafx-fxml-17.0.0.1.jar;C:\Users\yozsh\Downloads\openjfx-17.0.1_windows-x64_bin-sdk\javafx-sdk-17.0.1\lib\javafx-swt.jar;C:\Users\yozsh\Downloads\openjfx-17.0.1_windows-x64_bin-sdk\javafx-sdk-17.0.1\lib\javafx.web.jar;C:\Users\yozsh\Downloads\openjfx-17.0.1_windows-x64_bin-sdk\javafx-sdk-17.0.1\lib\javafx.swing.jar -m com.example.beluxfx/com.example.beluxfx.HelloApplication
Error occurred during initialization of boot layer
java.lang.module.FindException: Module javafx.controls not found
Process finished with exit code 1