Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Sep 2008 03:07:27 -0700
From:      Jeremy Chadwick <koitsu@FreeBSD.org>
To:        Marcel Grandemange <thavinci@thavinci.za.net>
Cc:        freebsd-java@freebsd.org
Subject:   Re: Error: Can't find libjava.so
Message-ID:  <20080916100727.GA60836@icarus.home.lan>
In-Reply-To: <018f01c917e1$0e250f40$2a6f2dc0$@za.net>
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> <20080916043322.GA54034@icarus.home.lan> <018f01c917e1$0e250f40$2a6f2dc0$@za.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Sep 16, 2008 at 11:46:12AM +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
> 
> This went through successfully.
> 
> >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).
> 
> The Results....
> 
> /var/run/ld-elf.so.hints:
> 	search directories:
> /lib:/usr/lib:/usr/lib/compat:/usr/local/lib:/usr/local/diablo-jre1.6.0/lib/
> amd64
> 	0:-lc.7 => /lib/libc.so.7
> 	1:-lcrypt.4 => /lib/libcrypt.so.4
> 	2:-lkvm.4 => /lib/libkvm.so.4
> 	3:-lm.5 => /lib/libm.so.5
> 	4:-lmd.4 => /lib/libmd.so.4
> 	5:-lncurses.7 => /lib/libncurses.so.7
> 	6:-lncursesw.7 => /lib/libncursesw.so.7
> 	7:-lsbuf.4 => /lib/libsbuf.so.4
> 	8:-lutil.7 => /lib/libutil.so.7
> 	9:-lalias.6 => /lib/libalias.so.6
> 	10:-lbegemot.3 => /lib/libbegemot.so.3
> 	11:-lbsnmp.4 => /lib/libbsnmp.so.4
> 	12:-lcam.4 => /lib/libcam.so.4
> 	13:-ldevstat.6 => /lib/libdevstat.so.6
> 	14:-ledit.6 => /lib/libedit.so.6
> 	15:-lbsdxml.3 => /lib/libbsdxml.so.3
> 	16:-lgeom.4 => /lib/libgeom.so.4
> 	17:-lipsec.3 => /lib/libipsec.so.3
> 	18:-lipx.4 => /lib/libipx.so.4
> 	19:-lkiconv.3 => /lib/libkiconv.so.3
> 	20:-lpcap.5 => /lib/libpcap.so.5
> 	21:-lthr.3 => /lib/libthr.so.3
> 	22:-lufs.4 => /lib/libufs.so.4
> 	23:-lz.4 => /lib/libz.so.4
> 	24:-lavl.1 => /lib/libavl.so.1
> 	25:-lnvpair.1 => /lib/libnvpair.so.1
> 	26:-lumem.1 => /lib/libumem.so.1
> 	27:-luutil.1 => /lib/libuutil.so.1
> 	28:-lzfs.1 => /lib/libzfs.so.1
> 	29:-lzpool.1 => /lib/libzpool.so.1
> 	30:-lgcc_s.1 => /lib/libgcc_s.so.1
> 	31:-lreadline.7 => /lib/libreadline.so.7
> 	32:-lssp.0 => /lib/libssp.so.0
> 	33:-lcrypto.5 => /lib/libcrypto.so.5
> 	34:-lbsm.2 => /usr/lib/libbsm.so.2
> 	35:-lcom_err.4 => /usr/lib/libcom_err.so.4
> 	36:-lelf.1 => /usr/lib/libelf.so.1
> 	37:-lform.4 => /usr/lib/libform.so.4
> 	38:-lmenu.4 => /usr/lib/libmenu.so.4
> 	39:-lpanel.4 => /usr/lib/libpanel.so.4
> 	40:-lformw.4 => /usr/lib/libformw.so.4
> 	41:-lmenuw.4 => /usr/lib/libmenuw.so.4
> 	42:-lpanelw.4 => /usr/lib/libpanelw.so.4
> 	43:-lnetgraph.3 => /usr/lib/libnetgraph.so.3
> 	44:-lradius.3 => /usr/lib/libradius.so.3
> 	45:-lrpcsvc.4 => /usr/lib/librpcsvc.so.4
> 	46:-ltacplus.3 => /usr/lib/libtacplus.so.3
> 	47:-lypclnt.3 => /usr/lib/libypclnt.so.3
> 	48:-larchive.4 => /usr/lib/libarchive.so.4
> 	49:-lbluetooth.3 => /usr/lib/libbluetooth.so.3
> 	50:-lbz2.3 => /usr/lib/libbz2.so.3
> 	51:-lcalendar.4 => /usr/lib/libcalendar.so.4
> 	52:-ldevinfo.4 => /usr/lib/libdevinfo.so.4
> 	53:-lfetch.5 => /usr/lib/libfetch.so.5
> 	54:-lftpio.7 => /usr/lib/libftpio.so.7
> 	55:-lgpib.2 => /usr/lib/libgpib.so.2
> 	56:-lgssapi.9 => /usr/lib/libgssapi.so.9
> 	57:-lmagic.3 => /usr/lib/libmagic.so.3
> 	58:-lmemstat.2 => /usr/lib/libmemstat.so.2
> 	59:-lmilter.4 => /usr/lib/libmilter.so.4
> 	60:-lmp.6 => /usr/lib/libmp.so.6
> 	61:-lncp.3 => /usr/lib/libncp.so.3
> 	62:-lngatm.3 => /usr/lib/libngatm.so.3
> 	63:-lopie.5 => /usr/lib/libopie.so.5
> 	64:-lpam.4 => /usr/lib/libpam.so.4
> 	65:-lpmc.4 => /usr/lib/libpmc.so.4
> 	66:-lkse.3 => /usr/lib/libkse.so.3
> 	67:-lrt.1 => /usr/lib/librt.so.1
> 	68:-lsdp.3 => /usr/lib/libsdp.so.3
> 	69:-lsmb.3 => /usr/lib/libsmb.so.3
> 	70:-lthread_db.3 => /usr/lib/libthread_db.so.3
> 	71:-lugidfw.3 => /usr/lib/libugidfw.so.3
> 	72:-lusbhid.3 => /usr/lib/libusbhid.so.3
> 	73:-lwrap.5 => /usr/lib/libwrap.so.5
> 	74:-llwres.30 => /usr/lib/liblwres.so.30
> 	75:-ldialog.6 => /usr/lib/libdialog.so.6
> 	76:-lgomp.1 => /usr/lib/libgomp.so.1
> 	77:-lgnuregex.4 => /usr/lib/libgnuregex.so.4
> 	78:-lhistory.7 => /usr/lib/libhistory.so.7
> 	79:-lstdc++.6 => /usr/lib/libstdc++.so.6
> 	80:-lobjc.3 => /usr/lib/libobjc.so.3
> 	81:-lasn1.9 => /usr/lib/libasn1.so.9
> 	82:-lgssapi_krb5.9 => /usr/lib/libgssapi_krb5.so.9
> 	83:-lhdb.9 => /usr/lib/libhdb.so.9
> 	84:-lkadm5clnt.9 => /usr/lib/libkadm5clnt.so.9
> 	85:-lkadm5srv.9 => /usr/lib/libkadm5srv.so.9
> 	86:-lkafs5.9 => /usr/lib/libkafs5.so.9
> 	87:-lkrb5.9 => /usr/lib/libkrb5.so.9
> 	88:-lroken.9 => /usr/lib/libroken.so.9
> 	89:-lssl.5 => /usr/lib/libssl.so.5
> 	90:-lssh.4 => /usr/lib/libssh.so.4
> 	91:-lcharset.1 => /usr/local/lib/libcharset.so.1
> 	92:-liconv.3 => /usr/local/lib/libiconv.so.3
> 	93:-lintl.8 => /usr/local/lib/libintl.so.8
> 	94:-lasprintf.0 => /usr/local/lib/libasprintf.so.0
> 	95:-lgettextpo.3 => /usr/local/lib/libgettextpo.so.3
> 	96:-lusb-0.1.8 => /usr/local/lib/libusb-0.1.so.8
> 	97:-lusbpp-0.1.8 => /usr/local/lib/libusbpp-0.1.so.8
> 	98:-lupsclient.1 => /usr/local/lib/libupsclient.so.1
> 	99:-lXau.6 => /usr/local/lib/libXau.so.6
> 	100:-lXau.0 => /usr/local/lib/libXau.so.0
> 	101:-lXdmcp.6 => /usr/local/lib/libXdmcp.so.6
> 	102:-lX11.6 => /usr/local/lib/libX11.so.6
> 	103:-lXext.6 => /usr/local/lib/libXext.so.6
> 	104:-lXi.6 => /usr/local/lib/libXi.so.6
> 	105:-lXp.6 => /usr/local/lib/libXp.so.6
> 	106:-lICE.6 => /usr/local/lib/libICE.so.6
> 	107:-lSM.6 => /usr/local/lib/libSM.so.6
> 	108:-lXt.6 => /usr/local/lib/libXt.so.6
> 	109:-lXtst.6 => /usr/local/lib/libXtst.so.6
> 
> > >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/dia
> blo-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.
> 
> Yup worked flawlessly on that part, but this always helps in the learning
> process ;>
> 
> However even after that I was still presented with a......
> 
> [root@testvmbsd /opt/MonitorSoftware]# ./agent start
>  Starting Agent:
> Error: can't find libjava.so.
> 
>  Done
> [root@testvmbsd /opt/MonitorSoftware]#

I'm making some assumptions about this Java software.  I want to assume
that libjava.so is shared library that programs are actually linked to
(e.g. ldd /some/binary/that/uses/libjava should show libjava.so.X in
the list of libraries) during link-time (e.g. gcc -o binary -ljava).

It's also possible that libjava.so isn't linked to programs, but instead
is loaded directly by some code using dlopen(3) and friends, and tha
the "Error" message is coming from those programs and not from ld.so
itself.

With the above patch, your ldconfig hint paths are right, but libjava.so
isn't in the list of libraries it recognised.  That indicates the
shared library was built in an odd way,, was built on another
architecture or version of FreeBSD which semantically is different, or
contains some low-level oddity which ld.so is refusing to cooperate with
(e.g. Linux binary).

What does "file /usr/local/diablo-jre1.6.0/lib/amd64/libjava.so" return?

Let's move this discussion to freebsd-java@freebsd.org.  I've changed
the CC list to point there.  Please keep me in the CC list, as
freebsd-java is not a list I follow.

This also sounds very similar to what you're experiencing:

http://lists.freebsd.org/pipermail/freebsd-java/2008-September/007657.html

-- 
| 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 |




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080916100727.GA60836>