I was trying to make a JavaFX
project with Kotlin, Gradle on IntelliJ IDEA.
Using Java 17.
At first, I didn’t used module-info.java
, and it worked well, but it warned me
"WARNING: Unsupported JavaFX configuration: classes were loaded from 'unnamed module @34277041'"
So I added module-info.java
to the project:
module org.example.javafxdemo {
requires javafx.controls;
requires javafx.fxml;
requires kotlin.stdlib;
opens org.example.javafxdemo to javafx.fxml;
exports org.example.javafxdemo;
}
project structure:
project
+ src
+ kotlin
+ org.example.javafxdemo
+ HelloApplication.kt
+ module-info.java
But then it causes error:
Error occurred during initialization of boot layer
java.lang.module.FindException: Module javafxdemo.main not found
What I tried:
I made a new Kotlin Project, includes only main.kt and module-info.java, and it warned same warning, so I think module-info.java is the problem, but JavaFX requires module-info.java..
I tried putting the source files of both languages in the same source directory, but it didn’t work.
Thank you so much!