How can I set the java.library.path for a whole Eclipse Project? I'm using a Java library that relies on OS specific files and need to find a .dll/.so/.jnilib. But the Application always exits with an error message that those files are not found on the library path.
I would like to configure this whole project to use the library path. I tried to add the path as a VM argument to some run configurations in eclipse but that didn't work.
Except the way described in the approved answer, there's another way if you have single native libs in your project.
the easiest way would to use the eclipse IDE itself. Go to the menu and set build path. Make it point to the JAVA JDK and JRE file path in your directory. afterwards you can check the build path where compiled files are going to be set. in the bin folder by default though. The best thing would be to allow eclipse to handle itself the build path and only to edit it similar to the solution that is given above
You can simply add
-Djava.library.path=yourPath
to theeclipse.ini
.Click Run
Click Debug ...
New Java Application
Click Arguments tab
in the 2nd box (VM Arguments) add the -D entry
etc...
None of the solutions above worked for me (Eclipse Juno with JDK 1.7_015). Java could only find the libraries when I moved them from project_folder/lib to project_folder.
Just add the *.dll files to your c:/windows
You can get the java.library.path from the follow codes:and then add you dll files under any path of you get