Fakrudeen Fakrudeen - 2 months ago 8
Java Question

Java.library.path setting programmatically

Can I set java.library.path programmatically from java code itself?

The following doesn't work.

System.setProperty("java.library.path", "/blah");

Answer

No you can't. This property is a read only value. You can change it at JVM launchin time with:

-Djava.library.path=your_path

If you want to load a library from a specific location, you can use System.load(libraryPath) instead with the full path to the library.

Comments