Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Java by (3.4k points)

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.

1 Answer

0 votes
by (46k points)

Don't mess with the library path! Eclipse creates it!

Instead, go into the library frameworks for your projects and, for each jar/etc that requires a native library, expand it in the Libraries tab. In the tree opening there, each library has items for source/Javadoc and local library locations.

Specifically: select Project, right-click -> Properties / Java Build Path / Libraries tab, select a .jar, develop it, choose Native library location, click Edit, folder chooser dialog will seem)

Messing with the library path on the command list should be your last-ditch application because you might disclose something that is already properly set by the eclipse.

Native library location

Browse Categories

...