Difference between System.load() and System.loadLibrary in Java

JavaDynamic Loading

Java Problem Overview


What is the difference between System.load() and System.loadLibrary() in java?

I want to load a library but I don't want to add the path to environment variables. Will any one of these help?

Java Solutions


Solution 1 - Java

The difference is there in the API documentation. System.loadLibrary(String libname) lets you load from the default path -- The Java library path.

The other System.load(String filename) lets you load it from an absolute path, which you must specify as your filename.

If you don't want to mess with you java.library.path environment variable, you should use System.load()

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionjavaManView Question on Stackoverflow
Solution 1 - JavaKalView Answer on Stackoverflow