Skip to content
Advertisement

Java required module can’t be found

I have a basic JavaFX project set up in IntelliJ:

enter image description here

The project uses Gradle for dependency management. The dependency that was added by my is javax.mail.api as you can see in the build.gradle file here:

JavaScript

The iissue I have now is that when trying to execute to programm with the following run configuration:

enter image description here

I get the following exception:

enter image description here

The module-info.java file specifies the added dependency module:

JavaScript

My question is why the module cannot be found?

Thank you for your patience and help.

Advertisement

Answer

The mail API jar from your dependency doesn’t define a module-info.class.

The new Jakarta mail API does define the file. Migrate your usage of javax.mail to jakarta.mail packages and use the updated artifact, should work then.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement