>>> Source unpacked. >>> Compiling source in /var/tmp/portage/dev-java/ant-core-1.7.0/work/apache-ant-1.7.0 ... ... Bootstrapping Ant Distribution ... Compiling Ant Classes /opt/sun-jdk-1.6.0/bin/javac: error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory ... Failed compiling Ant classes ! Bootstrap FAILED !!! ERROR: dev-java/ant-core-1.7.0 failed. Call stack: ebuild.sh, line 1611: Called dyn_compile ebuild.sh, line 968: Called qa_call 'src_compile' environment, line 4373: Called src_compile ant-core-1.7.0.ebuild, line 52: Called die !!! build failed !!! If you need support, post the topmost build error, and the call stack if relevant. !!! A complete build log is located at '/var/tmp/portage/dev-java/ant-core-1.7.0/temp/build.log'. !!! When you file a bug report, please include the following information: GENTOO_VM=sun-jdk-1.6 CLASSPATH="" JAVA_HOME="/opt/sun-jdk-1.6.0" JAVACFLAGS="-source 1.4 -target 1.4" COMPILER="" Reproducible: Always Portage 2.1.2-r5 (default-linux/x86/2006.1/desktop, gcc-4.1.1, glibc-2.5-r0, 2.6.19-gentoo-r2-01 i686) ================================================================= System uname: 2.6.19-gentoo-r2-01 i686 unknown Gentoo Base System release 1.12.9 Timestamp of tree: Thu, 01 Feb 2007 04:30:01 +0000 dev-java/java-config: 1.3.7, 2.0.31-r3 dev-lang/python: 2.4.4 dev-python/pycrypto: 2.0.1-r5 sys-apps/sandbox: 1.2.18.1 sys-devel/autoconf: 2.13, 2.61 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10 sys-devel/binutils: 2.17 sys-devel/gcc-config: 1.3.14 sys-devel/libtool: 1.5.22 virtual/os-headers: 2.6.19.2-r2 ACCEPT_KEYWORDS="x86 ~x86" AUTOCLEAN="yes" CBUILD="i686-pc-linux-gnu" CFLAGS="-O3 -march=pentium4 -fforce-addr -fomit-frame-pointer -ftracer -pipe" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config" CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/java-config/vms/ /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c" CXXFLAGS="-O3 -march=pentium4 -fforce-addr -fomit-frame-pointer -ftracer -pipe -fvisibility-inlines-hidden" DISTDIR="/usr/portage/distfiles" FEATURES="autoconfig distlocks metadata-transfer sandbox sfperms strict userpriv usersandbox" GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo" LINGUAS="en_US ja ko zh_CN zh_TW" MAKEOPTS="-j1" PKGDIR="/usr/portage/packages" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="X aac aalib acpi aim alsa arts audiofile avi bash-completion berkdb bitmap-fonts bonobo bzlib cairo cdb cdr cjk cli cracklib crypt cups curl curlwrappers dbus dga dio divix4linux dlloader dri dvd dvdr eds emboss encode esd fam fbcon firebird firefox flac font-server foomaticdb fortran ftp gb gd gdbm gif gnome gnutils gphoto2 gpm gstreamer gtk gtk2 hal iconv ipv6 isdnlog jack java jikes jpeg kde ldap libg++ mad mbox midi mikmod mime mmx mozilla mp3 mpeg msn ncurses nls nptl nptlonly nsplugin nvidia ogg oggvorbis openall opengl oss pam pcre pdflib perl png posix ppds pppd python qt qt3 qt4 quicktime readline reflection samba sdl session slang sockets softmmu spell spl sse ssl svga tcltk tcpd tetex tiff truetype truetype-fonts type1-fonts udev unicode videos vorbis win32codecs x86 xine xml xml2 xorg xv yahoo zlib" ALSA_CARDS="emu10k1" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en_US ja ko zh_CN zh_TW" USERLAND="GNU" VIDEO_CARDS="apm ark ati chips cirrus cyrix dummy fbdev glint i128 i740 i810 imstt mga neomagic nsc nv rendition s3 s3virge savage siliconmotion sis sisusb tdfx tga trident tseng v4l vesa vga via vmware voodoo" Unset: CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY The funny part about this is that the file that can not be found, libjli.so, is located at /opt/sun-jdk-1.6.0/jre/lib/i386/jli/libjli.so. So I figure that this is not the location that libjli.so is being looked for at, so a sym link seems to be in order here, just have no idea where.
(In reply to comment #0) I think that I managed to find a solution to this. After trying a few locations for a sym link to /opt/sun-jdk-1.6.0/jre/lib/i386/jli/libjli.so I found that ln -s /opt/sun-jdk-1.6.0/jre/lib/i386/jli/libjli.so /lib/libjli.so allows dev-java/ant-core-1.7.0 to build.
This looks more like sun-jdk-1.6 was installed incorrectly than an ant build error. Would you be able to post the output of java-config --list-available-vm Could you then emerge -C <any java packages> emerge -C <any jdk's/jre's> !!! IMPORTANT !!! remove that link you created. emerge =sun-jdk-6* run revdep-rebuild -vv --ignore --pretend If that shows nothing amiss then emerge =ant-core-1.7*
(In reply to comment #2) localhost / # java-config --list-available-vm The following VMs are available for generation-2: 1) Sun JDK 1.4.2.13 [sun-jdk-1.4] 2) Sun JDK 1.5.0.10 [sun-jdk-1.5] *) Sun JDK 1.6.0 [sun-jdk-1.6]
Does it happen also if you just run "javac" from command line? How bout with different JDK versions than 1.6? Do you have latest java-config installed? Did you alter it in any way?
(In reply to comment #2) Tried removing everything java, jdk's, and jre's. emerged =sun-jdk-1.6* revdep-rebuild -vv --ignore --pretend had nothing to rebuild. emerge =ant-1.7* failed with same failure as before.
(In reply to comment #4) > Does it happen also if you just run "javac" from command line? How bout with > different JDK versions than 1.6? > Do you have latest java-config installed? Did you alter it in any way? > had same failure with javic from the cli. Did not try other jdk versions before I wiped them out. Latest java-config as this is a new install, did not alter java-config.
Please try other versions (1.5 at least) then.
Oh and do you have this result too? # which javac /usr/bin/javac Any difference if you run just "javac" (that's /usr/bin/javac if the above is true for you) and if you run "/opt/sun-jdk-1.6.0/bin/javac" explicitly?
(In reply to comment #8) Bothe give the same result localhost / # /opt/sun-jdk-1.6.0/bin/javac /opt/sun-jdk-1.6.0/bin/javac: error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory localhost / # javac /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
betelgeuse@pena ~/bin $ for file in $(qlist sun-jdk-1.6); do scanelf -L -n -q -F '%n #F' ${file} | grep libjli && echo ${file}; done betelgeuse@pena ~/bin $ No needed markings at least. betelgeuse@pena ~/test/java $ strace javac Hello.java 2>&1 | grep libjli betelgeuse@pena ~/test/java $ Could you post the output of that strace above.
Some useful posts I found: http://forums.java.net/jive/thread.jspa?messageID=110779 http://help.lockergnome.com/linux/lib-found-ftopict355202.html Please post the output of echo $PATH from a shell session where you get the javac failure.
(In reply to comment #11) $PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin: /usr/i686-pc-linux-gnu/gcc-bin/4.1.1:/opt/sun-jdk-1.4.2.13/bin: /opt/sun-jdk-1.4.2.13/jre/bin:/opt/sun-jdk-1.4.2.13/jre/javaws: /usr/kde/3.5/sbin:/usr/kde/3.5/bin:/usr/qt/3/bin:/opt/firebird/bin
(In reply to comment #10) the strace returns nothing. this problem seems to affect all java.
> CFLAGS="-O3 -march=pentium4 -fforce-addr -fomit-frame-pointer -ftracer -pipe" > CXXFLAGS="-O3 -march=pentium4 -fforce-addr -fomit-frame-pointer -ftracer -pipe > -fvisibility-inlines-hidden" The best guess I can make is that your CFLAGS are causing some weirdness. Could try rebuilding everything with just "-O3 -march=pentium4 -fomit-frame-pointer -pipe".
(In reply to comment #14) Got your sugstion a little late as I restarted fresh with my original CFLAGS and CXXFLAGS. The only difference being that instead of building along side my fully functional system in chroot, I booted into the new system when first bootable and built in a normal environment. Everything installed perfectly with no compile failures. My best guess at this point is that sun-java does not like being installed in a chroot environment, some sort of unexpected interplay between the live system and chroot.
OK let's close this then, unless somebody wants to try to reproduce it and find the (ch)root cause :)
Same here, strange...
Strange. Yesterday had same problem here... It was a new install from stage3-i686-2007.0. After emerge -uDN world and emerge sun-jdk got this error, so this could be way to reproduce the problem... I've workarounded it with LDPATH: LDPATH="/opt/sun-jdk-1.6.0.03/jre/lib/i386/:/opt/sun-jdk-1.6.0.03/jre/lib/i386/native_threads/:/opt/sun-jdk-1.6.0.03/jre/lib/i386/xawt/:/opt/sun-jdk-1.6.0.03/jre/lib/i386/server/:/opt/sun-jdk-1.6.0.03/jre/lib/i386/jli/" but today I've removed LDPATH and everything works. Also I did copied all opt/sun-jdk-1.6.0.03 directory and it did not change since the time I had this error...
Well. I have this error again. Currently I `export LD_LIBRARY_PATH=/opt/sun-jdk-1.6.0.03/jre/lib/i386/jli/` to make java working... Any ideas what should I look at? How linker by idea was supposed to find out this library path?
Well the problem is that proc filesystem was not mounted and that caused linker not to use RPATH. I think that the best solution for this bug is to check if /proc is mounted. Something like this: if [ "$(uname)" = "Linux" ] ; then [ -d "/proc/self/" ] || eerror "/proc is not mounted, do this: mount -t proc proc /proc" exit 1 fi This will fix this problem in linux. I do not know anything about BSD/Solaris and friends but seems that /proc is not so required there...
Created attachment 137533 [details, diff] java.patch Attached patch fixes the problem for linux. I do not have solaris and I do not know how linker works there (or in other words does this bug affects solaris or not) but from irc conversation with Petteri Räty it's known that solaris also checks for /proc/self/exe to find out where we are installed, so it might be affected: ./j2se/src/solaris/bin/java_md.c: const char* self = "/proc/self/exe"; This problem comes from our java installation method, we suppose users to run our java wrapper and when they do so we rely on /proc to be mounted. That's why it's good idea to check for that and issue some clear message to our users. If users run java using full path, they are on their own and they have different solutions for this problem: either mount proc or define LDPATH in /etc/env.d and thus modify /etc/ld.so.conf or define LD_LIBRARY_PATH. For general solution possible fix - modification of /etc/ld.so.conf could break users vm.
bsd: Any ideas how diablo loads it's libs?
Added a check to java-check-environment.
*** Bug 179481 has been marked as a duplicate of this bug. ***
(In reply to comment #21) > Created an attachment (id=137533) [edit] > java.patch > Not every JDK needs that file so I think we should make it a bit smarter and only check it for JDKs that have a key for the check in their env file.
*** Bug 207370 has been marked as a duplicate of this bug. ***
*** Bug 225293 has been marked as a duplicate of this bug. ***
Maybe we should release the updated java-check-environment
*** Bug 235721 has been marked as a duplicate of this bug. ***
Found my own work around. For some reason, jre was being installed PRIOR to ant. So I ran the emerge, let it die, then copied the libjli.so file to /usr/lib and re-ran the emerge (it generated the .so fine, just wasn't looking for it). The re-run emerge worked fine for me. I know it's hardly the best fix, but at least it's a usable work around for now.
*** Bug 255500 has been marked as a duplicate of this bug. ***
oh man, this /proc thing definitely caught me with my vserver setup. i was trying to execute java in chroot, instead of "vserver <machine> enter".
sun-jdk has been last-rited.