libgcj-4 puts /usr/lib before LD_LIBRARY_PATH in any case
Yuval Kfir
yuvalk@mainsoft.com
Wed Nov 22 14:18:00 GMT 2006
Your system configuration is slightly different, Andrew, but you _have_
in fact reproduced the problem: before searching /mnt/zebedee and
/home/aph/..., the Java run-time looks for libpoo under
/usr/lib64/gcj-4.1.1.
If there were a gcj-related library named libpoo, it would have found it
before your library, no matter how you set up LD_LIBRARY_PATH.
Where does the 'pre-configured' /usr/lib64/gcj-4.1.1, in your case, come
from?
- Yuval
> OK, I tried this:
>> I have two libraries in . libpoo.so and libpoo2.so
>> LD_LIBRARY_PATH=/mnt/zebedee:/home/aph/gcc/gcj-eclipse-merge-
> branch/install/lib64/
>> $ ldd libpoo.so
> libpoo2.so => /mnt/zebedee/libpoo2.so (0x00002aaaaabae000)
> libc.so.6 => /lib64/libc.so.6 (0x00002aaaaacc7000)
> /lib64/ld-linux-x86-64.so.2 (0x0000555555554000)
>> public class p
> {
> public static void main(String[] s)
> {
> System.loadLibrary("poo");
> }
> }
>> $ strace -f -etrace=file ./a.out
> ...
> [pid 3019] open("/usr/lib64/gcj-4.1.1/libpoo.la", O_RDONLY) = -1
ENOENT
> (No such file or directory)
> [pid 3019] open("/mnt/zebedee/libpoo.la", O_RDONLY) = -1 ENOENT (No
such
> file or directory)
> [pid 3019] open("/home/aph/gcc/gcj-eclipse-merge-
> branch/install/lib64/libpoo.la", O_RDONLY) = -1 ENOENT (No such file
or
> directory)
> [pid 3019] open("/mnt/zebedee/libpoo.la", O_RDONLY) = -1 ENOENT (No
such
> file or directory)
> [pid 3019] open("/home/aph/gcc/gcj-eclipse-merge-
> branch/install/lib64/libpoo.la", O_RDONLY) = -1 ENOENT (No such file
or
> directory)
> [pid 3019] open("/lib64/libpoo.la", O_RDONLY) = -1 ENOENT (No such
file
> or directory)
> [pid 3019] open("/usr/lib64/libpoo.la", O_RDONLY) = -1 ENOENT (No
such
> file or directory)
> [pid 3019] open("libpoo.la", O_RDONLY) = -1 ENOENT (No such file or
> directory)
> [pid 3019] access("/usr/lib64/gcj-4.1.1/libpoo.so", R_OK) = -1 ENOENT
(No
> such file or directory)
> [pid 3019] access("/mnt/zebedee/libpoo.so", R_OK) = 0
[snip]
> I certainly can't see libgcj looking lin /usr/lib* for .so files.
>> Andrew.
More information about the Java
mailing list