I am trying to build a virtual piano app where i need the MediaPlayer class to play the notes, my project is a modular maven project with fxml, javafx 11.0.2 and java 14.
The problem that i can not import the MediaPlayer class, i tried to add requires javafx.media;
to my module-info.java but it doesn't recognize it anyways.
Here is my module-info.java
module org.project {
requires javafx.controls;
requires javafx.fxml;
opens org.project to javafx.fxml;
exports org.project;
}
Also tried to download the library jar but it is empty.
Also tried to add a maven dependency in the pom.xml file as following:
<!-- https://mvnrepository.com/artifact/org.openjfx/javafx.media -->
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx.media</artifactId>
<version>11.0.0-ea1</version>
<type>pom</type>
</dependency>
My pom.xml dependencies:
<dependencies>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-fxml</artifactId>
<version>11.0.2</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>11.0.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.openjfx/javafx.media -->
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx.media</artifactId>
<version>15</version>
<type>pom</type>
</dependency>
</dependencies>
and it shows that the repository is not found.