From: http://blog.csdn.net/grtwall/archive/2009/03/03/3954328.aspx
When using system. loadlibrary () to call C ++ DLL, you must determine the dll path. I have tried both methods to achieve this.
1. Set environment variables.
For example, if the edited DLL is in the directory "D: \ cppprojects \ nativecode \ release", you can copy the path and add it to the PATH variable in the environment variable of your computer.
2. Set project properties.
Right-click the project name | select Properties | select "Java build path" in the list on the left | select "Source" on the right tab | click "+" before the project name, select "Native library location" and "edit" and select the path "D: \ cppprojects \ nativecode \ release" above. (If you copy the DLL to the workspace, you can also use the relative path. You can also right-click "src" to set the native library item in its properties .)