which path will system load a JNI library from

734 views
Skip to first unread message

xeagle

unread,
Feb 16, 2011, 1:57:49 AM2/16/11
to android-ndk
Hi,

In my app, I'm using "System.loadLibrary()" to load my JNI library. It
should load library from "/data/data/myapp/lib/".
Then I add a invocation of "System.getenv("LD_LIBRARY_PATH")", and
found that this system env is "/system/lib/". Does that means that
system will load library from "/system/lib/" first? I think it is TRUE
for a system app, not my app. I'm confused.

alan

unread,
Feb 17, 2011, 4:22:17 AM2/17/11
to andro...@googlegroups.com
yes system libraries do seem to have priority, if you have a shared library with the same name as a system library you will not be able to load it

fadden

unread,
Feb 17, 2011, 4:58:12 PM2/17/11
to android-ndk
On Feb 17, 1:22 am, alan <a...@birtles.org.uk> wrote:
> yes system libraries do seem to have priority, if you have a shared library
> with the same name as a system library you will not be able to load it

This was changed in 2.3 (gingerbread). Now app lib directories come
first in the search path.
Reply all
Reply to author
Forward
0 new messages