0

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.

Shau
  • 1
  • Make sure to re-import the project: https://stackoverflow.com/a/43192764/104891. – CrazyCoder Apr 05 '23 at 15:00
  • Remove `pom` from the `javafx-media` dependency. – jewelsea Apr 05 '23 at 16:21
  • IntelliJ IDEA even the Ultimate version doesn't support the media package, you have to install JMF(Java Media Framework) and set path in libraries. Here is the download link for JMF:" https://www.oracle.com/java/technologies/javase/jmf-211e-download.html – Farkhod Abdukodirov Apr 06 '23 at 07:04
  • @FarkhodAbdukodirov Apps that use JavaFX media can be developed in Idea. I do not recommend using JMF in a JavaFX app. JMF is simply ancient. The hardware requirements are “166 MHz Pentium, 160 MHz PowerPC, or 166 MHz UltraSparc”. Those are museum pieces. I recommend using JavaFX media in JavaFX applications. Or, in some corner cases like mkv file playback, the JavaFX library for vlcj. – jewelsea Apr 06 '23 at 07:21

0 Answers0