java.lang.module.findexception: module javafx.controls not found

Cause of java.lang.module.findexception: module javafx.controls not found

We are getting a java.lang.module.findexception: module javafx.controls not found error. This means that the JavaFX module we are trying to use, javafx.controls, is not found.

 

There are a few things we can do to fix this. The first is to make sure that we have the JavaFX module installed. The second is to make sure that we are using the correct name for the module. The third is to make sure that we are importing the module correctly.

 

 

First Fix of java.lang.module.findexception: module javafx.controls not found

After some digging, I found that this is a known issue with Java 11 and IntelliJ. The solution is to add the javafx.controls module to your project. To do this, open the Project Structure dialog (File > Project Structure), and select Modules. Under the Dependencies tab, click the + button and select javafx.controls. Click OK, and then rebuild your project.

Now you should be able to work on your JavaFX project without any errors.

 

 

Second Fix of this exception:

If you’re running as a Non-Modular application on IntelliJ, then you need to recheck adding the VM argument as:

--module-path /path/to/javafx-sdk-11.0.1/lib --add-modules=javafx.controls,javafx.fxml

You can also follow the documentation of JavaFX and IntelliJ and after that check the documentation of Non-modular from IDE for complete setup details.

 

 

Also, Read Java Tutorials.

 

 

Share this post

Leave a Reply

Your email address will not be published. Required fields are marked *