I am working with a colleague on a JavaFX application, using IntelliJ IDEA. His latest work included using the javafx.media module. I pulled his work and tried to launch it, but to no avail. I get the following error message :
java: module not found: javafx.media
I have checked the pom.xml file, to see if the dependency is actually present. Here are the first dependencies :
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>19</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-fxml</artifactId>
<version>19</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-media</artifactId>
<version>19</version>
<type>pom</type>
</dependency>
The javafx-media module is present. Next, I checked the module-info.java file to see if it was called :
requires javafx.controls;
requires javafx.fxml;
requires javafx.media;
However, only the javafx.media part is labelled in red. All the other modules are found and when I remove javafx.media and everything that descends from it, it runs.