Login  Register

Loading native DLLs into InageJ

Posted by Burger Wilhelm on Sep 23, 2015; 2:14pm
URL: http://imagej.273.s1.nabble.com/Loading-native-DLLs-into-InageJ-tp5014423.html

Hello all, I wonder if someone can help me with the following technical problem:

I am loading a native DLL into ImageJ (e.g., for using OpenGL or OpenCV, under Windows). Everything works nicely if I execute precompiled plugins that use the native methods in that DLL, even repeatedly. However, when I  execute the same plugin with "Compile and run" I get the following errors:

java.lang.UnsatisfiedLinkError: Native Library XXX.dll already loaded in another classloader

As a remedy I tried to load the DLL by a static block of a special class, placed in a separate JAR file (read somewhere that this might help), and referenced that class "by name" - but with no avail.

I am not sure I understand well enough how class loaders and DLLs work together but assume somebody else must have encountered the same mess before. Any hints or suggestions for how to solve this?

Thanks much,
Wilhelm

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html