我正在尝试使用 VLCJ,并陷入了他们的第一个教程。
这是我的代码:
package vlcj.tutorial1;
import uk.co.caprica.vlcj.binding.LibVlc;
import uk.co.caprica.vlcj.runtime.RuntimeUtil;
import com.sun.jna.Native;
import com.sun.jna.NativeLibrary;
public class Tutorial1A
{
public static void main(String[] args)
{
// Ensure we're using the 32bit jdk.
System.out.println("jdk version: " + System.getProperty("sun.arch.data.model") + " bits.");
NativeLibrary.addSearchPath(RuntimeUtil.getLibVlcLibraryName(), "C:/Program Files (x86)/VideoLAN/VLC/sdk/lib");
Native.loadLibrary(RuntimeUtil.getLibVlcLibraryName(), LibVlc.class);
}
}
这是我得到的输出和异常:
jdk version: 32 bits.
Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to load library 'libvlc': The specified module could not be found.
at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:169)
at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:242)
at com.sun.jna.Library$Handler.<init>(Library.java:140)
at com.sun.jna.Native.loadLibrary(Native.java:368)
at com.sun.jna.Native.loadLibrary(Native.java:353)
at vlcj.tutorial1.Tutorial1A.main(Tutorial1A.java:17)
我确定我使用的是 32 位 jdk 和 32 位版本的 VLC。
有任何想法吗?提前致谢!