about JNI (Re: NBIO (Non-blocking I/O))
From: Kenneth Pronovici <pronovic@skyjammer.com>
Subject: Re: NBIO (Non-blocking I/O)
Date: Mon, 11 Feb 2002 13:29:10 -0600
> > > 4) Is it my responsibility to ensure that the system-wide
> > > $LD_LIBRARY_PATH includes /usr/lib/java (or /usr/lib/java/jni),
> > > so that the JNI libraries are found?
> > IMO, You should not defined it. Because JNI libraries are used by only
> > Java applications. Java applications should define $LD_LIBRARY_PATH
> > when they are executed.
>
> Upon further thought, I don't think I understand this. How is this
> expected to work?
>
> I don't recall that I've ever worked with a program that modified
> its own LD_LIBRARY_PATH. I guess I've generally expected that the
> environment would be set up prior to running the program, as the program
> itself couldn't really be expected to understand the environment it's
> running in.
I mean that other than Java use LD_LIBRARY_PATH. So, LD_LIBRARY_PATH
shouldn't be defined _system-wide_. I think LD_LIBRARY_PATH should be
defined at _startup script_.
For example, ant has startup script in /usr/bin/ant. If ant use JNI
(in fact, it's not used), LD_LIBRARY_PATH is defined at /usr/bin/ant.
Or it should be define at JVM startup script (like
/usr/lib/j2sdk1.3/bin/java ,/usr/bin/kaffe/bin/java, etc...)
regards,
----
Takashi Okamoto
Reply to: