I am trying to use native code in my Eclipse 4 app. I read several wikis and blogs but I can't get it to work. The issue is that the native code has dependencies to other native code and it isn't resolved by Eclipse.
What I have done so far is to create a project that contains the third-party JAR and the native code DLL's. The fragment approach described by Alex Blewitt here didn't even find the DLL's at all.
DLLs are a pain, but even more so if you have DLLs relying on other DLLs. If you have inter-DLL dependencies, you have either (1) do loadLibrary() for each in turn, or (2) place the dependencies somewhere on your PATH/LD_LIBRARY_PATH/DYLD_LIBRARY_PATH.
Thanks Brian, I tried (1) but it seems to be too late. So I need to ensure that the code is executed at startup. I think one option would be to tell my product to start the plugin containing the service at a very early stage or need to determine how to tell it in another way. The idea behind it is to create an OSGi service that can be added to the Eclipse IDE, and there I do not know how to tell the product to start my plugin earlier. Any hints appreciated.
It's hard to know what to suggest without seeing some sample code. If your class' static code isn't being called, then either that object hasn't been referenced or the exceptions in static code are being swallowed. You could put a class-load breakpoint there to be sure.
Put an exception breakpoint on UnsatisfiedLinkError too. At least you'll see what library you're dealing with.