0

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
Bogger
  • 1
  • 2
  • 1
    Is `--module-path \path\to\javafx-sdk-17\lib` in the actual command? – mcalex Nov 20 '21 at 01:22
  • What do you mean? I am very new to this – Bogger Nov 20 '21 at 02:24
  • 1
    Your command that starts java has a parameter: `--module-path \path\to\javafx-sdk-17\lib`. The '\path\to\' bit should be a location on your PC. Where did you install the javafx sdk? Change '\path\to\' to that location. – mcalex Nov 20 '21 at 06:10
  • 1
    In other words, `\path\to\javafx-sdk-17\lib` is typically used as a placeholder. You need to replace it with the actual path to the JavaFX SDK that you downloaded. – Slaw Nov 20 '21 at 06:42
  • 1
    Check out [Getting Started with JavaFX 11+](https://openjfx.io/openjfx-docs/). – Slaw Nov 20 '21 at 06:43

0 Answers0