From owner-freebsd-java Wed Oct 11 8:46:24 2000 Delivered-To: freebsd-java@freebsd.org Received: from magic.adaptec.com (magic.adaptec.com [208.236.45.80]) by hub.freebsd.org (Postfix) with ESMTP id 2046B37B66C for ; Wed, 11 Oct 2000 08:46:22 -0700 (PDT) Received: from kingdom.adaptec.com (kingdom.adaptec.com [162.62.50.10]) by magic.adaptec.com (8.8.8+Sun/8.8.8) with ESMTP id IAA25641; Wed, 11 Oct 2000 08:44:13 -0700 (PDT) Received: from btc.btc.adaptec.com (btc.btc.adaptec.com [162.62.64.10]) by kingdom.adaptec.com (8.8.8+Sun/8.8.8) with ESMTP id IAA16266; Wed, 11 Oct 2000 08:44:12 -0700 (PDT) Received: from btcexc01.btc.adaptec.com (btcexc01 [162.62.147.10]) by btc.btc.adaptec.com (8.8.8+Sun/8.8.8) with ESMTP id JAA20597; Wed, 11 Oct 2000 09:43:58 -0600 (MDT) Received: by btcexc01.btc.adaptec.com with Internet Mail Service (5.5.2650.21) id <44JJKZZX>; Wed, 11 Oct 2000 09:44:10 -0600 Message-ID: <3E0B8684A39BD411BB560000D11ABE9206E7F5@btcexc01.btc.adaptec.com> From: "Long, Scott" To: "'Greg Lewis'" , Henrik.Nilsson@west.se Cc: freebsd-java@freebsd.org Subject: RE: Re: native java on freebsd Date: Wed, 11 Oct 2000 09:44:10 -0600 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2650.21) Content-Type: text/plain Sender: owner-freebsd-java@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Speaking as someone who is supporting Java/JNI of FreeBSD for a commercial app, putting JNI's into a path already named by ldconfig (/usr/local/lib, for example) has yielded the best results. Scott -----Original Message----- From: Greg Lewis [mailto:glewis@trc.adelaide.edu.au] Sent: Wednesday, October 11, 2000 2:56 AM To: Henrik.Nilsson@west.se Cc: freebsd-java@freebsd.org Subject: Re: Re: native java on freebsd Henrik Nilsson wrote: > > The environment variable LD_LIBRARY_PATH needs to contain the path where > > the shared library can be found. > > > > HTH! > > It shared some light on the matter, but things still looks a bit hazy =) > > I have put the libhello.so (a simple hello world printout thingy) in > /usr/lib and it actually seems to find it. (because when I remove it I get > cannot find libhello.so error) Note what I said about LD_LIBRARY_PATH above. There is of course, the other option, which you took, of placing the library into a system directory which is searched for shared libraries as well. But in general you'll have to set up LD_LIBRARY_PATH to include the directory where your shared library resides. > but if I follow the compile instructions from the jni tutorial on > javasoft.com, it just doesn't work. I don't know what those instructions are off hand. You need to compile a shared library is the only requirement. If the JNI tutorial has appropriate instructions for doing so with gcc then you should be ok. It should be something like: gcc -o libhello.so -shared -fpic hello.c > The error I get is:"/usr/lib/libhello.so: unsupported file type > (libhello.so)" Determine if its actually a shared library. The 'file' command is your friend. E.g., # file /usr/lib/libc.so.4 /usr/lib/libc.so.4: ELF 32-bit LSB shared object, Intel 80386, version 1 (FreeBSD), stripped > Maybe I haven't compiled it properly, have any thoughts on that? See above. - Greg To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-java" in the body of the message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-java" in the body of the message