Oracle JRE, JavaFX and MediaPlayer crash (libav libraries detected but not used)

Hello everyone

I’m trying to use the Oracle JRE to build a Java app into a snap (basically building the app with OpenJDK, filtering out the OpenJDK JRE at prime time and using another part to download and bundle the Oracle JRE). The building is fine and I can run the app without any problems, but using the MediaPlayer class of JavaFX to play a sound like an MP3 file raises an exception and fails. I have tried adding libavcodec and libavformat (the variants available on Ubuntu 16.04), but that doesn’t do anything.

The relevant exception itself is the following :

com.sun.media.jfxmedia.MediaException: Could not create player!
    at com.sun.media.jfxmediaimpl.NativeMediaManager.getPlayer(NativeMediaManager.java:274) ~[jfxrt.jar:?]

No other details are given on the nature of the exception, the message itself being UNKNOWN…

The MediaPlayer works fine when using the Oracle JDK outside of a snap, so I don’t understand what’s going on.

This seems to be unrelated to libav libraries. After using a script to see which files are accessed by the process, it looks like Java accesses the libraries but never uses them. I have no idea of what I can do or even if this can be fixed.

As a side note, running it from the prime build folder (and making sure we’re using the bundled JRE) works fine. I don’t understand anything anymore.

Okay, I have new information on this. After trial, it seems all the audio part of JavaFX is broken, even with OpenJDK+OpenJFX. I will create a better topic.