Application, which is using 32-bit JVM on 64-bit system, doesn't work because of error: Exception in thread "main" java.lang.UnsatisfiedLinkError: jnidispatch (/com/sun/jna/linux-i386/libjnidispatch.so) not found in resource path at com.sun.jna.Native.loadNativeLibraryFromJar(Native.java:703) at com.sun.jna.Native.loadNativeLibrary(Native.java:680) at com.sun.jna.Native.<clinit>(Native.java:108) at javaapplication1.Main.<clinit>(Main.java:18) Could not find the main class: javaapplication1.Main. Program will exit.
Portage 2.1.8.3 (default/linux/amd64/10.0/desktop, gcc-4.4.3, glibc-2.11-r1, 2.6.33.2 x86_64) ================================================================= System uname: Linux-2.6.33.2-x86_64-Intel-R-_Core-TM-2_Quad_CPU_Q6600_@_2.40GHz-with-gentoo-1.12.13 Timestamp of tree: Mon, 05 Apr 2010 01:45:01 +0000 ccache version 2.4 [enabled] app-shells/bash: 4.1_p2-r1 dev-java/java-config: 2.1.10 dev-lang/python: 2.6.5-r1, 3.1.2-r1 dev-util/ccache: 2.4-r8 dev-util/cmake: 2.8.1 sys-apps/baselayout: 1.12.13 sys-apps/sandbox: 2.2 sys-devel/autoconf: 2.13, 2.65 sys-devel/automake: 1.9.6-r3, 1.10.3, 1.11.1 sys-devel/binutils: 2.20.1 sys-devel/gcc: 3.4.6-r2, 4.3.4, 4.4.3 sys-devel/gcc-config: 1.4.1 sys-devel/libtool: 2.2.6b virtual/os-headers: 2.6.33 ACCEPT_KEYWORDS="amd64 ~amd64" ACCEPT_LICENSE="* -@EULA PUEL dlj-1.1" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-O2 -pipe -fomit-frame-pointer" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/share/X11/xkb /usr/share/config /var/bind" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo" CXXFLAGS="-O2 -pipe -fomit-frame-pointer" DISTDIR="/mnt/distfiles" FEATURES="assume-digests ccache distlocks fixpackages metadata-transfer news parallel-fetch protect-owned sandbox sfperms splitdebug strict unmerge-logs unmerge-orphans userfetch userpriv webrsync-gpg" LDFLAGS="-Wl,-O1 -Wl,--hash-style=both" LINGUAS="en_GB" MAKEOPTS="-j 4" PKGDIR="/cache/packages" PORTAGE_CONFIGROOT="/" PORTAGE_RSYNC_EXTRA_OPTS="-z" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages" PORTAGE_TMPDIR="/cache" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="32bit 386 7zip X a52 aac accessibility acl acpi adns aiglx alsa amd64 ao apm asf avi bash-completion berkdb bitmap-fonts branding bzip2 cairo cdr chm cjk cli cracklib crypt css customlog cxx dbus dri dts dv dvb dvdr dvdread emboss emerald encode epoll exif extensions faad ffmpeg fftw firefox flac ftp fts3 gd gdbm gif glibc-omitfp glitz glx gnutls gpm graphite graphviz gs gtk2 gzip hddtemp iconv iostats ipv6 ithreads java java6 jpeg jpeg2k kde kdehiddenvisibility kqemu lame lcms libg++ libwww live lm_sensors logrotate lzma lzo mad matroska md5sum mikmod mmx mmxext mng modules mozdevelop moznocompose moznoirc moznomail mp3 mp4 mpeg mplayer mpx mudflap multilib ncurses network nodrm nptl nptlonly nsplugin nvidia ogg oggvorbis openal opencore-amr opengl openmp pam pango pch pcre pdf pdflib png ppds pppd qt qt3support qt4 qthelp quicktime readline redland reflection rtc sdl secure-delete semantic-desktop session slang sndfile spell spl sql sqlite sqlite3 srt sse sse2 ssl ssse3 startup-notification stream svg symlink sysfs theora threads threadsafe tiff unicode usb v4l v4l2 virtuoso vorbis webkit x264 xcb xcomposite xft xml xml2 xorg xrandr xv xvid zip zlib" ALSA_CARDS="virtuoso" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en_GB" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="nvidia" Unset: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS
Application works after I downloaded 32-bit version of libjnidispatch.so from https://jna.dev.java.net/source/browse/*checkout*/jna/trunk/jnalib/dist/linux-i386.jar?rev=HEAD and stored as /usr/java/packages/lib/i386/libjnidispatch.so
A possible solution would be to install a precompiled 32bit libjnidispatch.so (shipped with the tarball) on amd64, preferably controlled by a 32bit flag. This is in the vein of emul-linux-x86-*. @multilib: Does this sound like a sane plan?
(In reply to comment #3) > A possible solution would be to install a precompiled 32bit > libjnidispatch.so (shipped with the tarball) on amd64, preferably controlled > by a 32bit flag. This is in the vein of emul-linux-x86-*. > > @multilib: Does this sound like a sane plan? I got a friendly hint that the experts for this question are part of the amd64 herd instead of multilib. Adding to CC. Thanks and sorry for the noise.
Wouldn't it fit on app-emulation/emul-linux-x86-java?
(In reply to comment #5) > Wouldn't it fit on app-emulation/emul-linux-x86-java? app-emulation/emul-linux-x86-java is simply x86 sun-jdk, the library libjnidispatch.so is part of the package jna and is built from source for the primary ABI and and not tied to the build jvm. emul-linux-x86-java isn't necessarily the only jvm affected. A user could simply install a 32bit JVM manually (for instance icedtea-bin tarball or direct download from oracle) and hit the same issue.
Ah, I see, we need dev-java/jna 32 bits libs then, isn't there any other java related lib needed in 32 bits version?
(In reply to comment #7) > Ah, I see, we need dev-java/jna 32 bits libs then, isn't there any other > java related lib needed in 32 bits version? libjnidispatch.so is the only native library of jna, the rest is java bytecode. The only dependency is libffi. The prebuilt 32bit libjnidispatch.so shipped with the tarball is statically linked against libffi.
Maybe I should add that the 32bit lib would be added to a jar archive so jna can find and load the appropriate libjnidispatch.so from classpath.
Created attachment 311607 [details] Ebuild for emul package using shipped .so Added jna-3.4.0-r1 to tree, which registers emul-linux-x86-jna as an optional dependency. The attached ebuild, if installed alongside jna, would make jna automatically work on 32bit JVMs.
done