I'm using OpenJDK 11 and OpenJFX 11.0.1 with Gradle in IntelliJ IDEA for my project. When I use javafx.base module, IntelliJ IDEA reports an error at line 1 (project module declaration) saying I'm not including the javafx.beans module (beans is a package in javafx.base module) in my module requirements. Gradle jar task executes without any errors or warnings so this error is likely related to IntelliJ IDEA.
Error message: "Module 'hr.caellian.lunar' reads package 'javafx.beans' for both 'javafx.base' and 'javafx.base'" If I remove 'javafx.base' requirement, 'javafx.base' from above error is replaced with the next javafx module.
I'm also getting a warnings at javafx module requirement lines: "Ambiguous module reference: javafx.base" for 'javafx.base' and so on for each javafx module.
Here's my module-info.java file:
module hr.caellian.lunar {
requires java.base;
requires kotlin.stdlib;
requires javafx.base;
requires javafx.controls;
requires javafx.fxml;
opens hr.caellian.lunar.gui to javafx.graphics;
requires org.kordamp.ikonli.javafx;
requires org.kordamp.iconli.core;
requires com.fasterxml.jackson.core;
requires com.fasterxml.jackson.databind;
requires com.fasterxml.jackson.dataformat.yaml;
requires arglib;
requires org.apache.bcel;
}
I looked online for a solution for at least half an hour now. All I found was a website saying only the modules I already included are necessary for JFX (which was for JavaFX 9 I think).
I redownloaded JavaFX modules to see if I missed copying something but I didn't - javafx.beans module doesn't exist.
'java --list-modules' doesn't list any javafx modules if that's a problem, although I gathered that it should only list jdk modules and OpenJFX is no longer included with OpenJDK.
I installed OpenJFX SDK into JDK folder (lib files copied to lib folder, same for legal), added javafx jar dependency files from lib folder of JDK11 in IDEA manually. I also added all jmod files to jmod folder of JDK11.
Is it possible JavaFX modules have bad module-info.java files or something like that? Is this IntelliJ IDEA bug?