You can also find another StackOverflow answer reinforcing this explanation, here. This behavior is strange, unexpected, and not well documented, but it is documented in the OpenJDK issue tracker here. However, if the native library dependency is a native library that you or someone else created, then it will not be found on the PATH unless you place it there. This is totally fine if the native library dependency is an operating system native library because it will be found on the PATH. Instead, it will only search the directories on PATH environment variable of the operating system. Since the operating system has no concept of the, it will not see any directories you place on the. However, if that native library declares any dependencies on other native libraries, then the operating system will be tasked with finding those native library dependencies. When calling System.loadLibrary(), the JVM will look on the for your native library. I'm doing my testing in Windows XP on a toshiba laptop. I'm doing my development in Visual Studio 2010 on a MacBook pro (via Parallels). jar that calls them - to ensure that they're on the right PATH.ĭoes anyone have any idea what's going on? I put all of these DLLs in the same directory - the same directory as the. The method names had somehow gotten mangled by the compiler, but I added linker flags and the dll method names now match those in my jni header file exactly. I fixed the method names in mylib.dll, as suggested here. DW gave a couple of warnings - that two libraries required by libsndfile, MPR.DLL and SHLWAPI.DLL, had "unresolved imports" - but the DW FAQ said that these warnings could be safely ignored. I've searched this site (and others) and I've tried a number of fixes: When I run my program it crashes with : C:\.path.\mylib.dll: Can't find dependent libraries. The JNI calls a custom library that I've written myself, let's say mylib.dll, and that depends on a 3rd party library, libsndfile-1.dll. I'm working on a Java project that uses the JNI.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |