问题
Building a java 8 (oracle) application that uses the JavaFX media player under linux. Needing MP3 support I identified that I needed to ensure that libavformat53 and libavcodec53 were installed on the system.
Now even though they are installed on the system and all the relavent .so files are linked and in the right locations. JavaFX still crashes when opening MP3s.
Any ideas why this is still occurring?
回答1:
Research
Digged deeper into the issue found target system I was installing on already had libav 55 libraries on it. Using strace I saw that java was trying to load version 55 of the libraries rather than 53.
The JavaFX Supported Configurations lists that only versions 52 and 53 are compatible. The loading of the 55 libraries seemed to be triggered by java thinking that it can load libavplugin55 which doesn't exist on the system. >.>
Solution
My temporary is solution to create a link libavplugin.so
in the java native libraries directory: /java_install_dir/lib/amd64
. This link points to libavplugin-53.so
in the same directory and causes priority loading of the libavplugin-53 rather than it's mystical cousin libavplugin-55.
Summary
In conclusion something about the presence of the newer libav libraries is causing java to load them over the older ones even though it's not compatible. I've seen this in that removing version 55 of format and codec libraries that the application then works.
来源:https://stackoverflow.com/questions/30768613/javafx-media-player-crashes-when-opening-mp3s-even-though-libav-53-libraries-are