1

Following the JavaFX IntelliJ modular with Gradle tutorial here, I downloaded the project from github and followed the instructions. When I do gradlew run, I get the error:

> Task :run FAILED Error occurred during initialization of boot layer java.lang.module.FindException: Error reading module: C:\Users\ANDREW-SL3\github\hellofx\build\classes\java\main Caused by: java.lang.module.InvalidModuleDescriptorException: Package hellofx.org.openjfx not found in module 

Since I made no modification to the project I assume I've done something else wrong but can't figure out what it is.

1 Answer 1

1

I have suffered the same problem. I think that it is related to a change in how latest Gradle versions (>= 6.4) treat modules. In my case this post helped me to solve it.

Basically, add this to your build.gradle file:

java { modularity.inferModulePath.set(true) } application { mainModule = 'hellofx' // name defined in module-info.java mainClass = 'org.openjfx.MainApp' } run { main = "$moduleName/org.openjfx.MainApp" } 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.