

IntelliJ IDEA 2021.2.3 (Community Edition) currently has some bugs and mistakes in the way it generates and uses JavaFX+Gradle+Kotlin projects using the Idea New JavaFX project wizard. I tried it in my environment (OS X), following the same steps and versions as you provide in your question, and I get the same result as you. It would appear that this is a general issue with Kotlin+Gradle in Idea when using the Java Platform module system, and that it is not a specific issue just with the code created by the Gradle+JavaFX+Kotlin "New JavaFX Project" wizard (which is what I had assumed it was). The root cause of the issue is explained in the attached youtrack case.


As noted by Andrey in comments, this appears to be an known bug:
