In case any of you want to use 1.1.7 and are having JNI problems, this
may help.

Brian
-- 
|-------------------------------|Software Engineer
|Brian Jones                    |[EMAIL PROTECTED]
|[EMAIL PROTECTED]                    |http://www.nortel.net
|http://www.classpath.org/      |------------------------------
------- Start of forwarded message -------
Resent-Date: Fri, 11 Dec 1998 07:26:24 -0500
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Date: Thu, 10 Dec 1998 22:11:05 +0000 (GMT)
From: Bernd Kreimeier <[EMAIL PROTECTED]>
To: Java Linux That Works <[EMAIL PROTECTED]>
Subject: Possible fix for JDK 1.1.7 JNI problems
Message-ID: <[EMAIL PROTECTED]>
Reply-To: Bernd Kreimeier <[EMAIL PROTECTED]>
Resent-Message-ID: <"GHJ4j3.0.oc6.XzGSs"@shell>
Resent-From: [EMAIL PROTECTED]
Resent-Sender: [EMAIL PROTECTED]
Content-Transfer-Encoding: 8bit


I have been reporting problems with JNI/Invocation
with JDK 1.1.7v1a+native for apps that use libdl.so,
a bug which has been confirmed by Blackdown.

By accident I discovered a quick patch on this problem
that seems to work fine on my Debian "slink" snapshot, 
so if you happen to be stuck with a similar problem, 
give it a try.


 #!/bin/sh
 # Preload JVM DLL, call app next.
 # The app in question is linked against libdl.so,
 #  but not linked against libjava.so. It does
 #  use dlopen("libJ.so"), and libJ.so is linked
 #  against libjava.so. libJ.so does invocation 
 #  of a JVM, app is not Java aware.
 # Without the preload, this fails 
 #  on every RH 5.x and Debian 2.x I tried so far.
 LD_PRELOAD="libjava.so" app


The funny thing is that I tried this rather by
accident. Rumor had it that the problem was due
to the order in which symbols are resolved, and
this makes sure that libjava.so gets resolved
first. See "man 8 ld.so":

 LD_PRELOAD
   A  whitespace-separated  list  of additional, user-
   specified, ELF shared libraries to be loaded before
   all  others.  This can be used to selectively over�
   ride functions in other shared libraries.

Who knows, maybe this works under other circumstances,
for other problems, too.

                                    b.



------- End of forwarded message -------

Reply via email to