java.lang.module.FindException: Module xyz.module not found, required by MySample

If I try to run/debug a module application in Eclipse I get the error:

java.lang.module.FindException: Module xyz.foobar not found, required by MySample

The cause seems to be that the modules are not added to to command line of the launcher. I use:

  • Eclipse 2024.-03 (4.31)
  • Gradle 8.4
  • Java 17

In the Project and External Dependencies the jar files are marked as is modular - not modifiable. If the flag is set then module-info.java compiled. The flag is not set if there is no module-info.java on Gradle Refresh. A new added module-info.java has then compiler errors.

This seems the module status is detected and set inside of Eclipse. But on the launcher it will only add to the classpath and not to the module path.

Is this a known problem? Are there any Eclipse, Buildship, Gradle versions that are not compatible? What is a recommended workaround?

Have you enabled module support for Gradle?

Window > Preferences: Gradle > Experimental features: Enable module support

1 Like

Thanks this solve the problem. Why the hell is this an experimental feature after all the years?