I'm writing an application that uses native code (which I didn't write) which is bundled in several DLLs. I put them into a folder \lib.
At first when I ran the app, it complained that it could not find main.dll (which is the DLL that depends on all others). So then, I tried setting -Djava.library.path and it found main.dll, but still gave me an error "can't find dependent libraries".
I read from http://dev.eclipse.org/newslists/news.eclipse.technology.equinox/msg01581.html
that this is caused because Windows looks in PATH for the DLLs the second time around. So I put the \lib folder into PATH environment variable, which made it work.
However, I would prefer not having to set environment variables.
Some more background info... I was actually able to use the same native code DLLs in a simpler project that just had all the source code and classes in the project root directory, which had all the DLLs too. I could do this without setting java.library.path or PATH. So I feel that it should be possible to do the same for the more complex project too.
One thing that puzzles me is why for the simple project, I didn't have to do anything (beside setting the classpath) and Windows was able to find the other DLLs that main.dll depends on but in the more complex project, Windows couldn't find them.
Any direction or hints would be greatly appreciated. Thanks!