Absolute Path in System.loadLibrary()
843829Jan 28 2002 — edited Jan 28 2002Hi JNI Gurus:
I finally give in ... and call for help ... after wasting a whole day, trying, searching the forums. Here's the problem:
I am loading native files in my applications. Everything works when I place the native libraries (.dlls) in a folder accessible to the PATH variable. However, I am not happy with it, I would like to put the native dlls in a subfolder of my application and not modify the PATH variable. Now, going through the forums posts, I have learnt that I can specify the full path of the dll in System.loadLibrary(). However, it doesn't work for me. Here are the results:
1. System.loadLibrary("mydll"); works fine when in PATH
2. System.loadLibrary("C:\mydlls\mydll"); erorrs - invalid escape character ... ofcourse!
3. System.loadLibrary("C:\\mydlls\\mydll"); erorrs - directory separator should not appear in library name
4. System.loadLibrary("C:/mydlls/mydll"); erorrs - C:/mydlls/mydll in java.library.path
What am I doing wrong here? Please help!
Kamran