Where to put native libraries?

I’am trying to build an addon which uses the pi4j library. Pi4j loads a native library from the default java library path, or if the lib is not found there it tries to copy the lib to the tmp directory. The second option does not seam to work with openhab, so I tried to copy the file to /usr/share/openhab2/runtime/lib and also to /usr/share/openhab2/runtime/lib/ext but openhab still just crashes when trying to load the library.

Did I use the right folder for the library or what could be the problem here? It works if I start OH2 with the root user, but not with the openhab user.

Edit: I just found out that the library needs root rights, except this enviroment variable is set:

I’ve now added this directly into the start.sh. Is there also a better way to add such variables? Is there a config file for this?