The way JNA works, I believe, on Windows is that it will first check jna.library.path for the dll, then the Windows path-variable as you have discovered.This: "-Djna.library.path=C:\Program Files\VideoLAN\VLC" doesn't work. It only works when the directory is added to the path-variable...
So, what is the exact line I need to add???
Since I don't run Windows, I can't test this for you and this might be a load of rubbish, but maybe it's because that path has spaces in it.
Did you also try (note the alternative placement of the quote characters):
Code: Select all
-Djna.library.path="c:\program files\videolan\vlc"
Code: Select all
-Djna.library.path=c:\progra~1\videolan\vlc
Code: Select all
System.out.println(System.getProperty("jna.library.path"));
If I remember correctly, someone, perhaps one of the JVLC developers, sent a patch to the JNA project asking to support this option. I don't know if the patch was ever accepted.Edit: does anyone know what this piece of code does?Since there is no OPTION_DLOPEN_GLOBAL in my Library...Code: Select all
Map options = new HashMap() { { put(Library.OPTION_DLOPEN_GLOBAL, Boolean.TRUE); } };
In the version of JNA originally used for JVLC, and the version of JNA available for my own bindings, this patch had not been applied to JNA so the library option is not available.
I don't have a link handy, but I'm pretty sure there's something on the JNA mailing lists about this, and why it was needed - it was not a recent post though.
I don't know if you still use my bindings, but I committed some debug code (just for you, even updated the jar file too!) to dump out where I think JNA is looking for the libvlc.dll - again, I can't test on Windows whether that debug is useful to you or not or even is correct, but it might be worth a try.
Or try kryptonite's suggestion of course.
All of the above obviously applies if you're using JVLC too, if you get this working, you can go back to JVLC if it suits you better.