Adding dll library in java using idea for using program

I am trying to add and use a program called JVLC in my program. I downloaded a zip file containing a jar file (jvlc.jar) for the java interface and 2 DLL files (jvlc.dll, libvlc.dll) and a folder containing many DLL files. when I run my program, an UnsatisfiedLinkError occurs. I used this code to add these two dll files to my project.

System.loadLibrary("C:\\Users\\sajad\\Documents\\Downloads\\Compressed\\JVLC\\jvlc.dll");
System.loadLibrary("C:\\Users\\sajad\\Documents\\Downloads\\Compressed\\JVLC\\libvlc.dll");

but still there is an error:

UnsatisfiedLinkError: The directory separator should not appear in the library name

Do I need to add all the folders in the library path? If so, how?

please guide me.

+3
source share
2 answers

System.loadLibrary (libName, ) . , Java zip.dll/zip.so(Linux), , Zip Deflater/Inflater zip .

dll, System.load(String filename), DLL java lib.

.


:

//Your code....
System.loadLibrary("C:\\Users\\sajad\\Documents\\Downloads\\Compressed\\JVLC\\jvlc.dll");
System.loadLibrary("C:\\Users\\sajad\\Documents\\Downloads\\Compressed\\JVLC\\libvlc.dll");

//Replace with this...
System.load("C:\\Users\\sajad\\Documents\\Downloads\\Compressed\\JVLC\\jvlc.dll");
System.load("C:\\Users\\sajad\\Documents\\Downloads\\Compressed\\JVLC\\libvlc.dll");
+6

:

  • LD_LIBRARY_PATH ( Linux/Unix) PATH (Windows), , .
  • .dll.
0

Source: https://habr.com/ru/post/1770142/


All Articles