-1

I'm trying to include video in a project on a node on auto-replay. I have looked around and found the .Scene.media.Media class but that is not actually built into Java FX11, from what I have found. IntelliJ doesn't let me import it.

Is there something I am missing? If I need a dependency, what is the best practice for correctly importing this into my project?

Thanks.

  • JavaFX was split into 7 modules in version 9. The media classes are in the `javafx.media` module. Also note that many distributions of the JDK/JRE, including the JDK provided by Oracle, does not include JavaFX since Java/JavaFX 11; you'll have to either download the JavaFX SDK from Gluon or use a build tool like Maven or Gradle and pull JavaFX from Maven Central. – Slaw Feb 21 '21 at 02:17
  • Hello, I'm already using Java FX 11 and the other modules work but .media does not. I tried importing javafx.media and it does not appear. The one thing I'm thinking is if my FXGL library I'm using overwrites it / deletes that somehow...I'm doing research. Thanks for the help – nbulgarides Feb 21 '21 at 03:21
  • Does this answer your question? [IntelliJ can't recognize JavaFX 11 with OpenJDK 11](https://stackoverflow.com/questions/52467561/intellij-cant-recognize-javafx-11-with-openjdk-11) – kleopatra Feb 21 '21 at 10:16
  • Hi Kleo, it does not. I am using IntelliJ (And love it) and my entire project is FX / FXGL and is working great, but it seems that the media module is blocked out. I just want to be able to display short videos in-program e.g cutscenes in a game. I'm contacting the developer of FXGL who is quite helpful and active on Gitter, this is the overall framework it's pretty cool Thanks for your help - https://github.com/AlmasB/FXGL – nbulgarides Feb 22 '21 at 17:29

1 Answers1

0

Java 11 SDK is not supported by oracle and hence not shipped with Oracle JDK 11. You can download JavaFX 11 SDK from here

More information from oracle here