Loading jni library


I think that’s quite interesting that we need to load the -Djava.library.path and the System.setProperty and why is that?!

  1. Set path in console when executing jar:
    java -Djava.library.path=./lib -jar myApplication.jar
  2. Set path in the code before loading library:
    System.setProperty("java.library.path", "./lib");

On this stackoverflow they discuss about this, it’s for some systems that do not load from the lib call.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s