问题描述
构建一个在linux下使用JavaFX媒体播放器的java 8(oracle)应用程序。需要MP3支持我发现我需要确保在系统上安装了libavformat53和libavcodec53。
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.
现在即使它们已经安装在系统上,所有的相关内容都是.so文件链接在正确的位置。打开MP3时,JavaFX仍会崩溃。
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?
推荐答案
研究
深入研究我发现的目标系统已经安装了libav 55库。使用strace我看到java试图加载库的55版而不是53版。
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.
列出了只有版本52和53兼容的版本。 55个库的加载似乎是由java认为可以加载系统上不存在的libavplugin55引发的。 >。>
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. >.>
我的临时解决方案是创建链接 libavplugin。所以
在java本机库目录中: / java_install_dir / lib / amd64
。此链接指向同一目录中的 libavplugin-53.so
,并导致libavplugin-53的优先加载,而不是神秘的堂兄libavplugin-55。
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.
总之,有关新libav库存在的一些事情导致java将它们加载到旧的libav库上,即使它不是兼容。我已经看到了这个,删除了应用程序随后工作的格式和编解码库的版本55.
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.
这篇关于即使存在libav 53库,JavaFX Media Player在打开MP3时也会崩溃?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!