gpt4 book ai didi

java - 无法加载libvlc : Unable to load library 'vlc'

转载 作者:太空宇宙 更新时间:2023-11-04 10:40:04 29 4
gpt4 key购买 nike

我刚刚开始使用 jlcj 来制作自己的视频播放器。我尝试了教程,但总是无法加载 libvlc.dylib。

我知道互联网上有很多类似的问题报告和解决方案。但是我尝试了,但仍然出现错误。

这是运行 uk.co.caprica.vlcj.test.environment.TroubleShooter 的日志。请您告诉我这个问题的原因和解决方案。

============================== 8< 8< 8< ==============================

Library name: vlc
libvlc shared object file name: libvlc.dylib
libvlc core shared object file name: libvlccore.dylib

SYSTEM PROPERTIES:
awt.toolkit=sun.lwawt.macosx.LWCToolkit
file.encoding=UTF-8
file.encoding.pkg=sun.io
file.separator=/
ftp.nonProxyHosts=local|*.local|169.254/16|*.169.254/16
gopherProxySet=false
http.nonProxyHosts=local|*.local|169.254/16|*.169.254/16
java.awt.graphicsenv=sun.awt.CGraphicsEnvironment
java.awt.printerjob=sun.lwawt.macosx.CPrinterJob
java.class.path=/Users/yasuosaito/Development/Workspace/vlcj/target/test-classes:/Users/yasuosaito/Development/Workspace/vlcj/target/classes:/Users/yasuosaito/.m2/repository/net/java/dev/jna/jna/4.1.0/jna-4.1.0.jar:/Users/yasuosaito/.m2/repository/net/java/dev/jna/jna-platform/4.1.0/jna-platform-4.1.0.jar:/Users/yasuosaito/.m2/repository/org/slf4j/slf4j-api/1.7.10/slf4j-api-1.7.10.jar:/Users/yasuosaito/.m2/repository/org/slf4j/slf4j-log4j12/1.7.10/slf4j-log4j12-1.7.10.jar:/Users/yasuosaito/.m2/repository/log4j/log4j/1.2.17/log4j-1.2.17.jar
java.class.version=52.0
java.endorsed.dirs=/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/jre/lib/endorsed
java.ext.dirs=/Users/yasuosaito/Library/Java/Extensions:/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/jre/lib/ext:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java
java.home=/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/jre
java.io.tmpdir=/var/folders/69/5_506wls4bj9vms7bsmg8q2h0000gn/T/
java.library.path=/Users/yasuosaito/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.
java.runtime.name=Java(TM) SE Runtime Environment
java.runtime.version=1.8.0_144-b01
java.specification.name=Java Platform API Specification
java.specification.vendor=Oracle Corporation
java.specification.version=1.8
java.vendor=Oracle Corporation
java.vendor.url=http://java.oracle.com/
java.vendor.url.bug=http://bugreport.sun.com/bugreport/
java.version=1.8.0_144
java.vm.info=mixed mode
java.vm.name=Java HotSpot(TM) 64-Bit Server VM
java.vm.specification.name=Java Virtual Machine Specification
java.vm.specification.vendor=Oracle Corporation
java.vm.specification.version=1.8
java.vm.vendor=Oracle Corporation
java.vm.version=25.144-b01
jna.library.path=/Applications/VLC.app/Contents/MacOS/lib
jna.platform.library.path=/usr/lib:/usr/lib
jnidispatch.path=/var/folders/69/5_506wls4bj9vms7bsmg8q2h0000gn/T/jna-1072754801/jna328949766312094835.tmp
os.arch=x86_64
os.name=Mac OS X
os.version=10.13.2
path.separator=:
socksNonProxyHosts=local|*.local|169.254/16|*.169.254/16
sun.arch.data.model=64
sun.boot.class.path=/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/jre/lib/resources.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/jre/lib/rt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/jre/lib/sunrsasign.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/jre/lib/jsse.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/jre/lib/jce.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/jre/lib/jfr.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/jre/classes
sun.boot.library.path=/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/jre/lib
sun.cpu.endian=little
sun.cpu.isalist=
sun.io.unicode.encoding=UnicodeBig
sun.java.command=uk.co.caprica.vlcj.test.environment.Troubleshooter
sun.java.launcher=SUN_STANDARD
sun.jnu.encoding=UTF-8
sun.management.compiler=HotSpot 64-Bit Tiered Compilers
sun.os.patch.level=unknown
user.country=JP
user.dir=/Users/yasuosaito/Development/Workspace/vlcj
user.home=/Users/yasuosaito
user.language=ja
user.name=yasuosaito
user.timezone=

ARCHITECTURE TELLS:
java.vm.name=Java HotSpot(TM) 64-Bit Server VM
os.arch=x86_64
sun.arch.data.model=64

PATH=/usr/bin:/bin:/usr/sbin:/sbin
/usr/bin
/bin
/usr/sbin
/sbin

jna.library.path=/Applications/VLC.app/Contents/MacOS/lib
/Applications/VLC.app/Contents/MacOS/lib found libvlc found libvlccore

java.library.path=/Users/yasuosaito/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.
/Users/yasuosaito/Library/Java/Extensions
/Library/Java/Extensions
/Network/Library/Java/Extensions
/System/Library/Java/Extensions
/usr/lib/java
.

Note that JNA does not use java.library.path, it is searched here for completeness.

LD_LIBRARY_PATH=<not-specified>

Load Library:
Failed to load libvlc: Unable to load library 'vlc': Native library (darwin/libvlc.dylib) not found in resource path ([file:/Users/yasuosaito/Development/Workspace/vlcj/target/test-classes/, file:/Users/yasuosaito/Development/Workspace/vlcj/target/classes/, file:/Users/yasuosaito/.m2/repository/net/java/dev/jna/jna/4.1.0/jna-4.1.0.jar, file:/Users/yasuosaito/.m2/repository/net/java/dev/jna/jna-platform/4.1.0/jna-platform-4.1.0.jar, file:/Users/yasuosaito/.m2/repository/org/slf4j/slf4j-api/1.7.10/slf4j-api-1.7.10.jar, file:/Users/yasuosaito/.m2/repository/org/slf4j/slf4j-log4j12/1.7.10/slf4j-log4j12-1.7.10.jar, file:/Users/yasuosaito/.m2/repository/log4j/log4j/1.2.17/log4j-1.2.17.jar])

============================== 8< 8< 8< ==============================

Note that CPU architecture detection is an informed *guess*, it may not be accurate.

It looks like you have a 64-bit OS because os.arch=x86_64.

It looks like you have a 64-bit JVM because java.vm.name=Java HotSpot(TM) 64-Bit Server VM.

If you are running a 64-bit JVM, then you need a 64-bit build of vlc.

If you only have a 32-bit build of vlc, then you can use a 32-bit JVM on your 64-bit OS.

libvlc was found in the following locations:
/Applications/VLC.app/Contents/MacOS/lib/libvlc.dylib

libvlccore was found in the following locations:
/Applications/VLC.app/Contents/MacOS/lib/libvlccore.dylib

libvlc could not be loaded.

============================== 8< 8< 8< ==============================

libvlc and libvlccore were found, so if the JVM CPU architecture matches your vlc build CPU architecture, you should be able to resolve this with configuration...

Some things to try:

Set this system property on the command-line : -Djna.library.path=/Applications/VLC.app/Contents/MacOS/lib
Set this system property in your Java code : System.setProperty("jna.library.path", "/Applications/VLC.app/Contents/MacOS/lib");
Add this statement to your Java code : NativeLibrary.addSearchPath("vlc", "/Applications/VLC.app/Contents/MacOS/lib");
Add this directory to your operating system path : /Applications/VLC.app/Contents/MacOS/lib

I will try setting the jna.library.path system property to '/Applications/VLC.app/Contents/MacOS/lib' for you...
Failed to load libvlc: Unable to load library 'vlc': Native library (darwin/libvlc.dylib) not found in resource path ([file:/Users/yasuosaito/Development/Workspace/vlcj/target/test-classes/, file:/Users/yasuosaito/Development/Workspace/vlcj/target/classes/, file:/Users/yasuosaito/.m2/repository/net/java/dev/jna/jna/4.1.0/jna-4.1.0.jar, file:/Users/yasuosaito/.m2/repository/net/java/dev/jna/jna-platform/4.1.0/jna-platform-4.1.0.jar, file:/Users/yasuosaito/.m2/repository/org/slf4j/slf4j-api/1.7.10/slf4j-api-1.7.10.jar, file:/Users/yasuosaito/.m2/repository/org/slf4j/slf4j-log4j12/1.7.10/slf4j-log4j12-1.7.10.jar, file:/Users/yasuosaito/.m2/repository/log4j/log4j/1.2.17/log4j-1.2.17.jar])

============================== 8< 8< 8< ==============================

最佳答案

cd src/main/resources/
cp -r /Applications/VLC.app/Contents/MacOS/lib darwin
rm darwin/*.*.*
cd darwin
install_name_tool -add_rpath @loader_path libvlc.dylib
mkdir vlc
cp -r /Applications/VLC.app/Contents/MacOS/plugins vlc/plugins

专为懒人而设。它对我有用,也许对你也有帮助。

关于java - 无法加载libvlc : Unable to load library 'vlc' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49090931/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com