I take part in developing a Java project, which uses some C++ components, thus I need Jacob.dll
. (on Windows 7)
I keep getting java.lang.UnsatisfiedLinkError: no JacobDB in java.library.path
no matter where I put Jacob.dll....
I looked for possible decisions and the one that I haven't tried so far is setting the LD_LIBRARY_PATH
variable, pointing at the .dll file.
I have little experience and I'm not familiar with what should be the meaning and usage of that variable - can you help me?
LD_LIBRARY_PATH is an environmental variable used in Linux/UNIX Systems. It is used to tell dynamic link loaders where to look for shared libraries for specific applications. It is useful until you don't mess with it.
PATH is for specifying directories of executable programs. LD_LIBRARY_PATH is used to specify directories of libraries. From other point of view, PATH is used primarily by the shell, while LD_LIBRARY_PATH is used by the dynamic loader (usually ld-linux.so ).
The value of the environment variable LD_LIBRARY_PATH is a colon-separated (:) set of directories where libraries are searched for first before the standard set of directories. If you are running on a Solaris system, the LD_LIBRARY_PATH environment variable is used to define the native library path.
LD_LIBRARY_PATH
is the predefined environmental variable in Linux/Unix which sets the path which the linker should look in to while linking dynamic libraries/shared libraries.
LD_LIBRARY_PATH
contains a colon separated list of paths and the linker gives priority to these paths over the standard library paths /lib
and /usr/lib
. The standard paths will still be searched, but only after the list of paths in LD_LIBRARY_PATH
has been exhausted.
The best way to use LD_LIBRARY_PATH
is to set it on the command line or script immediately before executing the program. This way the new LD_LIBRARY_PATH
isolated from the rest of your system.
Example Usage:
$ export LD_LIBRARY_PATH="/list/of/library/paths:/another/path" $ ./program
Since you talk about .dll
you are on a windows system and a .dll
must be placed at a path which the linker searches at link time, in windows this path is set by the environmental variable PATH
, So add that .dll
to PATH
and it should work fine.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With