Package com.example.demo not found in module

已回答

Intellij IDEA / Create project / JavaFX Generator / Gradle / Kotlin.

When run HelloApplication I get:

Error occurred during initialization of boot layer
java.lang.module.FindException: Error reading module: /Volumes/dev/demo2/build/classes/java/main
Caused by: java.lang.module.InvalidModuleDescriptorException: Package com.example.demo not found in module

Other variants work, e.g. Maven, or New Project. I'm new to Gradle but I suspect the problem lies with its config...

 


  

0
To simply running the sample project, you can delete the module-info.java file.

Please refer to the related issue for configuring Gradle Kotlin compilation with Java JPMS enabled.
https://youtrack.jetbrains.com/issue/KT-55200/Provide-documentation-how-to-configure-Gradle-Kotlin-compilation-with-Java-JPMS-enabled
1

请先登录再写评论。