Hi Amit,
2012/6/4 Supernatural <
amitvp...@gmail.com>:
> Thanks Oliver. It worked. Cool !
No pb :-)
> Small change - LoadLibrary now also accepts library name and the path.
> So now my new LoadLibrary function looks like this -
>
> public void LoadLibrary(String LibName, String path)
> {
> File libFile = BridJ.getNativeLibraryFile(path); //This should
> create a new library handle
> BridJ.setNativeLibraryFile(LibName, libFile); //This will add to
> a new entry in the map
> }
>
> But it uses the BridJ configuration only for the first LoadLibrary.
> Rest it seems to ignore or not seems to be in effect
The problem here is that you only have one library binding class. The
way JNI works, it is not possible to bind a given native method to
different native functions depending on the instance of your
TestLibrary1 class.
Also, the name declared by TestLibrary1's @Library annotation is the
one that will be used to perform the binding.
The only easy way to bind three identical libraries, in the current
state of BridJ, is to copy-paste your TestLibrary1 class for each copy
of the library, adjusting the name in the @Library annotation, and
just associate each name to its path.
Out of curiosity, why are you trying to load the library three times ?