1
votes

I have the following problem:

Error occurred during initialization of boot layer java.lang.module.FindException: Module javafx.controls not found

When I try to run the default class of JavaFX project which send a "Hello World" button, I'm using Netbeans 11.1 as my IDE, the JDK 13, Jre-8u221. I create the library Java Fx and added it to the module path inn the properties of my project and on VM on run options included the command --add-modules javafx.controls, javafx.graphics.

1
Is the directory which contains the JavaFX modules in the module path? For instance, java --module-path /home/edwin/helloworld/build:/opt/javafx/lib --module helloworld/com.example.helloworld.Main - VGR

1 Answers

0
votes

You need to add the module-info.java file in the same package as the class that contains the Main method. Inside this file (and implicitly inside the module definition block), there should be at least 1 line:

requires javafx.controls;

This should fix your problem.