各位大神們,學習java一段時間想用vlc制作一個視頻播放器。但是在使用vlc的時候出現以下異常:(在Windows 7 旗艦版)
Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to load library 'libvlc': Native library (win32-x86-64/libvlc.dll) not found in resource path
at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:271)
at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:398)
at com.sun.jna.Library$Handler.(Library.java:147)
at com.sun.jna.Native.loadLibrary(Native.java:412)
at com.sun.jna.Native.loadLibrary(Native.java:391)
at video.main.PlayMain.main(PlayMain.java:20)
下面是我的代碼:
public static void main(String[] args) {
if (RuntimeUtil.isWindows()) {
NativeLibrary.addSearchPath(RuntimeUtil.getLibVlcLibraryName (), "E:/Java/JavaSE/workspace/Video/lib/libvlc");
}
Native.loadLibrary(RuntimeUtil.getLibVlcLibraryName(), LibVlc.class);
//創建主窗體
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
frame = new MainFrame();
frame.setVisible(true);
frame.getMediaPlayer().playMedia("E:/學習視頻/Web大前端/第二階段/01.Web前段開發之jQuery入門課程/2.選擇器1");
} catch (Exception e) {
e.printStackTrace();
}
}
是win7 32bit還是64bit?要對應的庫。