> It,s better to do:
>
[quoted text clipped - 6 lines]
>
> Regards
is it possible to change the library path during runtime?
as such, i would read the library path from a config file and set the
library path in the program during runtime..
> System.loadLibrary("my"); // no absolute path and no (OS-specific)
> extension
Agreed.
> And then do on execution:
>
> java -Djava.library.path=C:\all-dll YourClass
Does that cause Windows to resolve a.dll and b.dll when they are loaded from
my.dll ? I'm willing to believe it is (presumably the JVM must add
java.library.path to the Windows %Path%), but would be surprised even so.
(Unfortunately, it's too much effort to set up a test.)
What I would do is ensure that my.dll, a.dll, and b.dll were all on the
%Path% -- either by changing the %Path% or by finding somewhere suitable on the
%Path% for them to live. In normal applications, the best place is in the same
directory as the application, but that might be awkward for Java (depending on
how the OP's deploying the program).
Another factor to consider is how my.dll is loading a.dll and b.dll. If it is
loading them implicitly (say by using a .lib stub) then the OS and/or the stub
will look for the secondary DLLs. But it's also possible that my.dll is
loading a.dll and b.dll from an explicitly defined location, in which case all
bets are off.
-- chris