各位大神们,学习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();
}
}