Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Portage & Programming
  • Search

libjli.so exists, but java can't find it

Problems with emerge or ebuilds? Have a basic programming question about C, PHP, Perl, BASH or something else?
Post Reply
Advanced search
20 posts • Page 1 of 1
Author
Message
ireneshusband
n00b
n00b
Posts: 9
Joined: Thu Sep 28, 2006 2:57 am

libjli.so exists, but java can't find it

  • Quote

Post by ireneshusband » Fri Nov 30, 2007 4:13 pm

A number of ebuilds fail on me with the message "/usr/lib/jvm/sun-jdk-1.6/bin/javac: error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory".

However libjli.so is definitely there:

Code: Select all

zebedee / # qfile libjli.so
dev-java/sun-jdk (/opt/sun-jdk-1.6.0.03/jre/lib/i386/jli/libjli.so)
dev-java/sun-jre-bin (/opt/sun-jre-bin-1.6.0.03/lib/i386/jli/libjli.so)
zebedee / # ls /opt/sun-jre-bin-1.6.0.03/lib/i386/jli/libjli.so
/opt/sun-jre-bin-1.6.0.03/lib/i386/jli/libjli.so
Why can't java find one of its own files?
Top
oliver
Apprentice
Apprentice
User avatar
Posts: 170
Joined: Wed Jun 25, 2003 9:39 pm

  • Quote

Post by oliver » Fri Nov 30, 2007 5:42 pm

what does ldd say?

$ ldd /usr/lib/jvm/sun-jdk-1.6/bin/javac
Top
ireneshusband
n00b
n00b
Posts: 9
Joined: Thu Sep 28, 2006 2:57 am

  • Quote

Post by ireneshusband » Sat Dec 01, 2007 5:53 am

Code: Select all

zebedee / # ldd /usr/lib/jvm/sun-jdk-1.6/bin/javac
        linux-gate.so.1 =>  (0xffffe000)
        libpthread.so.0 => /lib/libpthread.so.0 (0xb7ec0000)
        libjli.so => not found
        libdl.so.2 => /lib/libdl.so.2 (0xb7ebc000)
        libc.so.6 => /lib/libc.so.6 (0xb7d94000)
        /lib/ld-linux.so.2 (0xb7eee000)
Top
oliver
Apprentice
Apprentice
User avatar
Posts: 170
Joined: Wed Jun 25, 2003 9:39 pm

  • Quote

Post by oliver » Sun Dec 02, 2007 1:03 am

for me:

$ ldd /usr/lib/jvm/sun-jdk-1.6/bin/javac
linux-gate.so.1 => (0xffffe000)
libpthread.so.0 => /lib/libpthread.so.0 (0xb7f4f000)
libjli.so => /opt/sun-jdk-1.6.0.03/bin/../jre/lib/i386/jli/libjli.so (0xb7f46000)
libdl.so.2 => /lib/libdl.so.2 (0xb7f42000)
libc.so.6 => /lib/libc.so.6 (0xb7e12000)
/lib/ld-linux.so.2 (0xb7f81000)


I must admit, I thought this was definitely just a missing entry in /etc/ld.so.conf or /etc/env.d/20java but either of mine seem to have that path in there leading to libjli.so

You could probably add the path to /etc/ld.so.conf but there's probably a reason why this isn't working the correct way for you... sorry I couldnt be more helpful
Top
ireneshusband
n00b
n00b
Posts: 9
Joined: Thu Sep 28, 2006 2:57 am

  • Quote

Post by ireneshusband » Tue Dec 04, 2007 5:04 pm

oliver wrote:sorry I couldnt be more helpful
Please don't apologise. You are being helpful. :)

I'd like to try adding the path to /etc/ld.so.conf. The path itself is obvious, but how do I decide what hex value to put in brackets after it?
Top
oliver
Apprentice
Apprentice
User avatar
Posts: 170
Joined: Wed Jun 25, 2003 9:39 pm

  • Quote

Post by oliver » Tue Dec 04, 2007 5:49 pm

You shouldn't need to put any hex value in there... mine looks like this:

Code: Select all

# ld.so.conf autogenerated by env-update; make all changes to
# contents of /etc/env.d directory
/usr/local/lib
//usr//lib/opengl/xorg-x11/lib
/usr/i686-pc-linux-gnu/lib
/usr/lib/gcc/i686-pc-linux-gnu/4.1.2
/usr/lib/nspr
/usr/lib/nss
/usr/lib/openmotif-2.2
/opt/sun-jdk-1.4.2.16/jre/lib/i386/
/opt/sun-jdk-1.4.2.16/jre/lib/i386/native_threads/
/opt/sun-jdk-1.4.2.16/jre/lib/i386/classic/
/opt/sun-jdk-1.4.2.16/jre/lib/i386/server/
/usr/kde/3.5/lib
/usr/qt/3/lib
/usr/lib/libstdc++-v3/
then run ldconfig to re-read it.

I'd guess updating the /etc/env.d entry would be the appropriate way but I'm sure the quick and dirty method would work
Top
ireneshusband
n00b
n00b
Posts: 9
Joined: Thu Sep 28, 2006 2:57 am

  • Quote

Post by ireneshusband » Wed Dec 05, 2007 7:34 pm

That worked. Thanks!

I created a new file in /etc/env.d. I'm not sure if that was the proper way to do things but, as I said, it works.
Top
oliver
Apprentice
Apprentice
User avatar
Posts: 170
Joined: Wed Jun 25, 2003 9:39 pm

  • Quote

Post by oliver » Wed Dec 05, 2007 8:03 pm

glad to hear it's working... I'd love to hear what the real root cause is/was
Top
mcguire
n00b
n00b
User avatar
Posts: 19
Joined: Mon Nov 29, 2004 10:10 pm
Location: France

  • Quote

Post by mcguire » Fri Feb 01, 2008 11:22 am

Hi there

I've the same problem on a fresh install and I've a machine on which javac works:

fresh-install:

Code: Select all

# ldd /opt/sun-jdk-1.6.0.03/bin/javac
        libpthread.so.0 => /lib/libpthread.so.0 (0x00002b8737e1d000)
        libjli.so => not found
        libdl.so.2 => /lib/libdl.so.2 (0x00002b8738038000)
        libc.so.6 => /lib/libc.so.6 (0x00002b873823d000)
        /lib64/ld-linux-x86-64.so.2 (0x00002b8737c01000)
working machine:

Code: Select all

# ldd /opt/sun-jdk-1.6.0.03/bin/javac
        libpthread.so.0 => /lib/libpthread.so.0 (0x00002ba857d48000)
        libjli.so => /opt/sun-jdk-1.6.0.03/bin/../jre/lib/amd64/jli/libjli.so (0x00002ba857f63000)
        libdl.so.2 => /lib/libdl.so.2 (0x00002ba85806d000)
        libc.so.6 => /lib/libc.so.6 (0x00002ba858272000)
        /lib64/ld-linux-x86-64.so.2 (0x00002ba857b2c000)
On the working machine I can't find why this path is searched.

Code: Select all

# cat /etc/ld.so.conf
# ld.so.conf autogenerated by env-update; make all changes to
# contents of /etc/env.d directory
/usr/local/lib
//usr/lib32/opengl/nvidia/lib
//usr/lib64/opengl/nvidia/lib
/lib
/usr/lib
/lib64
/usr/lib64
/usr/local/lib64
/lib32
/usr/lib32
/usr/local/lib32
/usr/x86_64-pc-linux-gnu/lib
/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.2
/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.2/32
/usr/lib64/nspr
/usr/lib64/nss
/usr/lib/qt4
/usr/lib64/qt4
/usr/lib32/qt4
/usr/kde/3.5/lib
/usr/kde/3.5/lib64
/usr/kde/3.5/lib32
/usr/qt/3/lib
/usr/qt/3/lib64
/usr/qt/3/lib32
/usr/games/lib
/usr/games/lib32
/usr/lib32/libstdc++-v3/
And when searching myself:

Code: Select all

# grep -v '^#' /etc/ld.so.conf | while read line; do echo "-- $line"; find "$line" -iname 'libjli*'; done
-- /usr/local/lib
-- //usr/lib32/opengl/nvidia/lib
-- //usr/lib64/opengl/nvidia/lib
-- /lib
-- /usr/lib
-- /lib64
-- /usr/lib64
-- /usr/local/lib64
-- /lib32
-- /usr/lib32
-- /usr/local/lib32
-- /usr/x86_64-pc-linux-gnu/lib
-- /usr/lib/gcc/x86_64-pc-linux-gnu/4.1.2
-- /usr/lib/gcc/x86_64-pc-linux-gnu/4.1.2/32
-- /usr/lib64/nspr
-- /usr/lib64/nss
-- /usr/lib/qt4
-- /usr/lib64/qt4
-- /usr/lib32/qt4
find: `/usr/lib32/qt4': No such file or directory
-- /usr/kde/3.5/lib
-- /usr/kde/3.5/lib64
-- /usr/kde/3.5/lib32
-- /usr/qt/3/lib
-- /usr/qt/3/lib64
-- /usr/qt/3/lib32
-- /usr/games/lib
find: `/usr/games/lib': No such file or directory
-- /usr/games/lib32
find: `/usr/games/lib32': No such file or directory
-- /usr/lib32/libstdc++-v3/
I would like to understand why this failed on the fresh-install and correct it in the gentoo way.
Top
mcguire
n00b
n00b
User avatar
Posts: 19
Joined: Mon Nov 29, 2004 10:10 pm
Location: France

  • Quote

Post by mcguire » Fri Feb 01, 2008 11:38 am

I missed something : symbolic links.

Code: Select all

# grep -v '^#' /etc/ld.so.conf | while read line; do echo "-- $line"; find -L "$line" -iname '*libjli*'; done
-- /usr/local/lib
-- //usr/lib32/opengl/nvidia/lib
-- //usr/lib64/opengl/nvidia/lib
-- /lib
-- /usr/lib
/usr/lib/jvm/sun-jdk-1.6/jre/lib/amd64/jli/libjli.so
/usr/lib/jvm/emul-linux-x86-java-1.6/lib/i386/jli/libjli.so
-- /lib64
-- /usr/lib64
/usr/lib64/jvm/sun-jdk-1.6/jre/lib/amd64/jli/libjli.so
/usr/lib64/jvm/emul-linux-x86-java-1.6/lib/i386/jli/libjli.so
-- /usr/local/lib64
-- /lib32
-- /usr/lib32
-- /usr/local/lib32
-- /usr/x86_64-pc-linux-gnu/lib
-- /usr/lib/gcc/x86_64-pc-linux-gnu/4.1.2
-- /usr/lib/gcc/x86_64-pc-linux-gnu/4.1.2/32
-- /usr/lib64/nspr
-- /usr/lib64/nss
-- /usr/lib/qt4
-- /usr/lib64/qt4
-- /usr/lib32/qt4
find: `/usr/lib32/qt4': No such file or directory
-- /usr/kde/3.5/lib
-- /usr/kde/3.5/lib64
-- /usr/kde/3.5/lib32
-- /usr/qt/3/lib
-- /usr/qt/3/lib64
-- /usr/qt/3/lib32
-- /usr/games/lib
find: `/usr/games/lib': No such file or directory
-- /usr/games/lib32
find: `/usr/games/lib32': No such file or directory
-- /usr/lib32/libstdc++-v3/
Now that I can find why it is loaded, I try to locate the symbolic link :

Code: Select all

# ls -l /usr/lib/jvm/sun-jdk-1.6
lrwxrwxrwx 1 root root 21 Feb  1 12:09 /usr/lib/jvm/sun-jdk-1.6 -> /opt/sun-jdk-1.6.0.03
I've got a look on the fresh-install and the link is also present with the same name and the same target.

If I search libjli on the fresh-install like ld will do, I've got result :

Code: Select all

# grep -v '^#' /etc/ld.so.conf | while read line; do echo "-- $line"; find -L "$line" -iname '*libjli*'; done
-- /usr/local/lib
-- /lib
-- /usr/lib
/usr/lib/jvm/sun-jdk-1.6/jre/lib/amd64/jli/libjli.so
/usr/lib/jvm/sun-jre-bin-1.6/lib/amd64/jli/libjli.so
-- /lib64
-- /usr/lib64
/usr/lib64/jvm/sun-jdk-1.6/jre/lib/amd64/jli/libjli.so
/usr/lib64/jvm/sun-jre-bin-1.6/lib/amd64/jli/libjli.so
-- /usr/local/lib64
-- /lib32
-- /usr/lib32
-- /usr/local/lib32
-- /usr/x86_64-pc-linux-gnu/lib
-- /usr/lib/gcc/x86_64-pc-linux-gnu/4.1.2
-- /usr/lib/gcc/x86_64-pc-linux-gnu/4.1.2/32
-- /usr/lib/gcc/x86_64-pc-linux-gnu/4.1.1
find: `/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.1': No such file or directory
-- /usr/lib/gcc/x86_64-pc-linux-gnu/4.1.1/32
find: `/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.1/32': No such file or directory
So the library should get loaded correctly I guess.

I don't understand why I've got

Code: Select all

# ldd /opt/sun-jdk-1.6.0.03/bin/javac
        libpthread.so.0 => /lib/libpthread.so.0 (0x00002b5c9e5f9000)
        libjli.so => not found
        libdl.so.2 => /lib/libdl.so.2 (0x00002b5c9e814000)
        libc.so.6 => /lib/libc.so.6 (0x00002b5c9ea19000)
        /lib64/ld-linux-x86-64.so.2 (0x00002b5c9e3dd000)

# /opt/sun-jdk-1.6.0.03/bin/javac
/opt/sun-jdk-1.6.0.03/bin/javac: error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory
Top
sundialsvc4
Guru
Guru
Posts: 436
Joined: Thu Nov 10, 2005 12:50 am

  • Quote

Post by sundialsvc4 » Sat Feb 02, 2008 12:26 am

Well, I don't profess to be a "guru" on ld but it is my understanding that it works on a cached copy of linkage information ... which is built or re-built by the ldconfig command.

If you're getting "missing libraries," the first thing that I would do is to execute ldconfig (as root) just to make sure that the cache is up-to-date. Then try the ldd command again.

Beyond that, again it is my understanding that the libraries must be either in the "trusted" system directories /lib and /usr/lib, or in one of the directories in /etc/ld.so.conf, in order to be found by the loader. If any changes are made, ldconfig must be re-run.

Some "make" sequences execute that command for you; others don't.
Top
MasquedAvenger
Guru
Guru
User avatar
Posts: 559
Joined: Thu Aug 21, 2003 10:20 pm
Location: Southern California
Contact:
Contact MasquedAvenger
Website

  • Quote

Post by MasquedAvenger » Wed Mar 12, 2008 3:37 am

Try this:

do a "grep -R /var/db/pkg" and see which java package contains the libjli.so file. For me, it was installed via sun's jdk, yet blackdown is set as the default vm, which doesn't have libjli (a bug? Ebuilds should catch this sort of thing...)

Once I used eselect to choose the sun-jdk instead of blackdown ("eselect java-vm set sun-jdk-1.6"), the ebuild I was trying to build that failed worked.

James
"There are no uninteresting things; only uninterested people." --G.K. Chesterton
Top
mikkoc
Apprentice
Apprentice
Posts: 231
Joined: Thu May 24, 2007 9:07 am

  • Quote

Post by mikkoc » Thu Mar 27, 2008 4:19 pm

MasquedAvenger wrote: Once I used eselect to choose the sun-jdk instead of blackdown ("eselect java-vm set sun-jdk-1.6"), the ebuild I was trying to build that failed worked.
I'm having the same issue on a fresh gentoo install.
eselect already shows sun-jdk-1.6 as the default java-vm (it's the only one).
I'm not sure I understand how I should solve this.

Can anyone help?
thanks
Top
m0rtal
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 79
Joined: Mon Mar 21, 2005 10:52 am
Location: Yalta, Crimea

  • Quote

Post by m0rtal » Fri Apr 04, 2008 2:59 pm

ireneshusband wrote:I created a new file in /etc/env.d. I'm not sure if that was the proper way to do things but, as I said, it works.
what kind of file?!
software is like sex - better when it's free!
Top
alistair
Retired Dev
Retired Dev
User avatar
Posts: 869
Joined: Fri Jul 15, 2005 12:53 am

  • Quote

Post by alistair » Fri Apr 04, 2008 3:30 pm

m0rtal wrote:
ireneshusband wrote:I created a new file in /etc/env.d. I'm not sure if that was the proper way to do things but, as I said, it works.
what kind of file?!
I too would be interested in seeing the contents of that file?
______________
Help the gentoo-java project. Visit Gentoo Java Project

what good are admin powers if you don't abuse them for personal gain - mark_alec
Top
alistair
Retired Dev
Retired Dev
User avatar
Posts: 869
Joined: Fri Jul 15, 2005 12:53 am

  • Quote

Post by alistair » Fri Apr 04, 2008 3:36 pm

Firstly [bug=165330]The Bug[/bug]

secondly, do you have /proc mounted?
______________
Help the gentoo-java project. Visit Gentoo Java Project

what good are admin powers if you don't abuse them for personal gain - mark_alec
Top
m0rtal
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 79
Joined: Mon Mar 21, 2005 10:52 am
Location: Yalta, Crimea

  • Quote

Post by m0rtal » Sat Apr 05, 2008 9:01 pm

alistair wrote:secondly, do you have /proc mounted?
yes, that was the problem - I was doing emerge from existing Ubuntu and forgot to mount /proc
shame on me :(
software is like sex - better when it's free!
Top
ewildgoose
Tux's lil' helper
Tux's lil' helper
Posts: 76
Joined: Sun Mar 02, 2003 1:39 pm

  • Quote

Post by ewildgoose » Thu May 01, 2008 4:15 pm

I just ran into this same issue

Solved for me by resetting the VM

eselect java-vm set system sun-jdk-1.6

Now ldd shows that all is fine... It was a new install so perhaps something when wrong with the initial setup of the default JVM?
Top
ElCondor
Guru
Guru
User avatar
Posts: 520
Joined: Wed Apr 10, 2002 6:49 am
Location: Vienna, Austria, Europe
Contact:
Contact ElCondor
Website

mind the proc!

  • Quote

Post by ElCondor » Wed Dec 24, 2008 11:55 am

thanks, I had the same problem yesterday .. forgot to mount /proc to my chroot environment where I did the update!

though I'm using gentoo now for a decade, still making my mistakes ... ;)
Here I am the victim of my own choices and I'm just starting!
Top
lkraav
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 130
Joined: Wed Oct 13, 2004 9:43 pm
Location: Estonia

  • Quote

Post by lkraav » Sun Dec 25, 2011 6:57 pm

i ran into the same thing with /proc, on my vserver. just chrooting would throw this error, "vserver servername enter" is a better approach :>
Top
Post Reply

20 posts • Page 1 of 1

Return to “Portage & Programming”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic