From owner-freebsd-hackers@FreeBSD.ORG Tue Sep 16 04:33:25 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 410341065677 for ; Tue, 16 Sep 2008 04:33:25 +0000 (UTC) (envelope-from jdc@koitsu.dyndns.org) Received: from QMTA10.westchester.pa.mail.comcast.net (qmta10.westchester.pa.mail.comcast.net [76.96.62.17]) by mx1.freebsd.org (Postfix) with ESMTP id D84B78FC14 for ; Tue, 16 Sep 2008 04:33:24 +0000 (UTC) (envelope-from jdc@koitsu.dyndns.org) Received: from OMTA07.westchester.pa.mail.comcast.net ([76.96.62.59]) by QMTA10.westchester.pa.mail.comcast.net with comcast id FC9u1a0071GhbT85AGZQLh; Tue, 16 Sep 2008 04:33:24 +0000 Received: from koitsu.dyndns.org ([67.180.253.227]) by OMTA07.westchester.pa.mail.comcast.net with comcast id FGZN1a00J4v8bD73TGZPai; Tue, 16 Sep 2008 04:33:24 +0000 X-Authority-Analysis: v=1.0 c=1 a=QycZ5dHgAAAA:8 a=LWi8qTA7sAlec2zVewEA:9 a=MujUVwSs2Qav3CA8KgkA:7 a=0tf8RBd7xTndlYFww55h33nf3LoA:4 a=EoioJ0NPDVgA:10 a=LY0hPdMaydYA:10 Received: by icarus.home.lan (Postfix, from userid 1000) id 37EF117B81A; Mon, 15 Sep 2008 21:33:22 -0700 (PDT) Date: Mon, 15 Sep 2008 21:33:22 -0700 From: Jeremy Chadwick To: Marcel Grandemange Message-ID: <20080916043322.GA54034@icarus.home.lan> References: <015101c9164a$f3f12d30$dbd38790$@za.net> <20080915093815.GA33139@icarus.home.lan> <002b01c91737$2af8ac30$80ea0490$@za.net> <20080915152631.GA39924@icarus.home.lan> <00be01c9176a$182f3910$488dab30$@za.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <00be01c9176a$182f3910$488dab30$@za.net> User-Agent: Mutt/1.5.18 (2008-05-17) Cc: freebsd-hackers@freebsd.org Subject: Re: Error: Can't find libjava.so X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Sep 2008 04:33:25 -0000 On Mon, Sep 15, 2008 at 09:34:39PM +0200, Marcel Grandemange wrote: > > > I do realize this is probably better suited for freebsd-questions , > > however > > > haven't received any response and was simply hoping someone would be > kind > > > enough. > > > > > > I recently obtained a very decent ups, however it is not supported by > NUT. > > > > > > It does however come with winpower software that does run on FreeBSD. > > > > > > However it rewuired java. > > > > > > So installed from ports > > > > > > And was presented with following error: > > > > > > Error: can't find libjava.so > > > > > > This is on system in folder > > "/usr/local/Diablo-jre1.6.0/lib/amd64/libjava.so > > > > >Can you provide the output of "ldconfig -r" from that box? I have > > >a feeling the ld.so pathing hints might lack a directory or two. > > > > > > /var/run/ld-elf.so.hints: > > search directories: /lib:/usr/lib:/usr/lib/compat:/usr/local/lib > > >This is the problem as I see it. ld.so, which is used for finding and > >loading shared libraries, is not configured to look in > >/usr/local/Diablo-jre1.6.0/lib/amd64 for libraries. > > >I'd like to know which port you installed, and how you installed it. > > I did a cvsup on ports to update to latest on FreeBSD7.0 release amd64 > Used port /usr/ports/java/Diablo-jre16 > Simply did > Make > Make install > Make clean > Can you please apply the below patch and tell me if it solves your problem? Proper procedure should be: # cd /usr/ports/java/diablo-jre16 # patch < /wherever/the/patch/is # make clean # make # make deinstall # make install After this is done, use "ldconfig -r" and look at the search path shown at the top; hopefully /usr/local/diablo-jre1.6.0/lib/amd64 will be there, and libjava.so should be found (hopefully). > >Regarding the problem itself: there are ways to work around this by > >using the environment variable LD_LIBRARY_PATH. I do not recommend > >this, though -- properly configuring the ld.so search path when a > >program (or port) is installed is the proper method. > > Could you advise me how to do this? Hope you don't mind! Set the LD_LIBRARY_PATH environment variable to the search paths you desire. Colon-delimited, and it overrides the defaults. E.g. export LD_LIBRARY_PATH="/lib:/usr/lib:/usr/lib/compat:/usr/local/lib:/usr/local/diablo-jre1.6.0/lib/amd64" But the below patch, assuming it works (and I got the paths right), should not require you to do that. LD_LIBRARY_PATH is somewhat evil, and it's not recommended you use it. -- | Jeremy Chadwick jdc at parodius.com | | Parodius Networking http://www.parodius.com/ | | UNIX Systems Administrator Mountain View, CA, USA | | Making life hard for others since 1977. PGP: 4BD6C0CB | Index: Makefile =================================================================== RCS file: /home/pcvs/ports/java/diablo-jre16/Makefile,v retrieving revision 1.3 diff -u -r1.3 Makefile --- Makefile 20 Aug 2008 04:13:02 -0000 1.3 +++ Makefile 16 Sep 2008 04:24:27 -0000 @@ -43,6 +43,8 @@ INSTALL_DIR= ${PREFIX}/${PKGNAMEPREFIX}jre${JRE_VERSION} +USE_LDCONFIG= ${PREFIX}/${PKGNAMEPREFIX}jre${JRE_VERSION}/lib/${ARCH} + .include .if ${OSVERSION} >= 700000