Debian Bug report logs - #620122
libjna-java: JNA does not support multi-arch system library paths

version graph

Package: libjna-java; Maintainer for libjna-java is Debian Java maintainers <>; Source for libjna-java is src:libjna-java.

Reported by: James Page <>

Date: Wed, 30 Mar 2011 10:45:01 UTC

Severity: normal

Tags: patch

Found in version libjna-java/3.2.4-2

Fixed in version libjna-java/3.2.7-3

Done: Andrew Ross <>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox

Report forwarded to,, Debian Java maintainers <>:
Bug#620122; Package libjna-java. (Wed, 30 Mar 2011 10:45:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to James Page <>:
New Bug report received and forwarded. Copy sent to, Debian Java maintainers <>. (Wed, 30 Mar 2011 10:45:05 GMT) Full text and rfc822 format available.

Message #5 received at (full text, mbox):

From: James Page <>
To: Debian Bug Tracking System <>
Subject: libjna-java: JNA does not support multi-arch system library paths
Date: Wed, 30 Mar 2011 11:41:05 +0100
[Message part 1 (text/plain, inline)]
Package: libjna-java
Version: 3.2.4-2
Severity: normal
Tags: patch

Ubuntu has moved over to multi-arch based system libraries; the code in libjna-java
that generates the library search path does not support this directory structure.

The attached patched fixes this for archs supported on Ubuntu.

I would like to expand this to support all archs for Debian as well.

I have also reported this upstream -
[07-multiarch-support.patch (text/x-diff, attachment)]

Information forwarded to, Debian Java maintainers <>:
Bug#620122; Package libjna-java. (Wed, 30 Mar 2011 12:51:07 GMT) Full text and rfc822 format available.

Acknowledgement sent to James Page <>:
Extra info received and forwarded to list. Copy sent to Debian Java maintainers <>. (Wed, 30 Mar 2011 12:51:07 GMT) Full text and rfc822 format available.

Message #10 received at (full text, mbox):

From: James Page <>
To: Debian Java List <>
Subject: Impact of switching to multi-arch on Java & native library handling.
Date: Wed, 30 Mar 2011 13:32:50 +0100
[Message part 1 (text/plain, inline)]
Hi All

You may (or may not) know that Ubuntu Natty (the current development
release) has started to make the transition to multi-arch based
libraries (see [0] & [4]). 

This basically means that instead of libraries being located
in /usr/lib:/lib they are installed to architecture specific locations
(/usr/lib/i386-linux-gnu...), allowing libraries for multiple archs to
be installed on the same system (i386 and amd64 for example).

For the majority of Java code this will have no impact as the JVM
abstracts this underlying change away from the developer; however code
that integrates with native libraries is potentially impacted by this
change (see [1] & [2]).  

We encountered two separate issues in Ubuntu related to this

1) Incomplete library search paths

        openjdk-6 and libjna-java have both been updated to be
        multi-arch aware when generating paths for library searching;
        This was a fairly simple fix but it will need to be expanded to
        support all of the various architectures that Debian builds for
        over and above Ubuntu (see [3]).
        I have submitted the patch to libjna-java back upstream (see
        [2]) with these comments as anyone using JNA on a multi-arch
        enabled Linux distro will have this issue.

2) Version-less library names.
        The second issue (which is not directly related to the
        multi-arch change) related to how native libraries are typically
        loaded in Java code.  Calls to the loadLibrary function provided
        by the Java Runtime Environment simply take library names - for
        example 'pam'.  The JVM maps this to '' and then tries
        to resolve this against the native libraries on the system.
        This is OK where a library provides both the Java code and the
        native shared object (without a ABI version number) which should
        be installed to /usr/lib/jni.  However where the Java code is
        relying on a system library such as PAM this is unresolvable -
        i.e. the JRE will not be able to load the library as there is no
        version-less .so available.
        libjna-java works in a similar way but resolves this issue by
        'best matching' the library - i.e. it takes a guess at which
        version is required and picks the highest one it finds - this is
        inherently a little dangerous as the Java 'native' code might
        not map to the version it picks to load.
        libjna-java also understands versioned libraries and passes
        these directly to libdl to resolve - '' would be
        handled in this way.  This would be a better way to ensure that
        native Java integration is fixed and tested against a specific
        ABI version of the underlying native library.

The intent of this email is really to:

        a) give the team a heads-up on issue 1) as I believe Wheezy is
        due to move to multi-arch.
        b) generate some discussion around version-less system library
        handling. Hoping that JNA will match a request for 'xx' to the
        right version of library 'xx' does not feel like a good thing to
        be doing.

I don't think that this issue is particularly widespread in the Java
code-base in Debian or Ubuntu (not many libraries use libjna-java);
however I have at least two new packages I want to contribute that use
JNA in this way and it would be great to get a consensus on how to
handle this in Debian and derivatives.  

I think that fixing to a particular version of a library is the right
way to go - this can be managed using a patch and ensures that ABI
compatibility is maintained between the Java library and the native
system library for this type of package.




James Page
Software Engineer, Ubuntu Server Team
[signature.asc (application/pgp-signature, inline)]

Reply sent to Andrew Ross <>:
You have taken responsibility. (Fri, 27 May 2011 23:36:05 GMT) Full text and rfc822 format available.

Notification sent to James Page <>:
Bug acknowledged by developer. (Fri, 27 May 2011 23:36:05 GMT) Full text and rfc822 format available.

Message #15 received at (full text, mbox):

From: Andrew Ross <>
Subject: Bug#620122: fixed in libjna-java 3.2.7-3
Date: Fri, 27 May 2011 23:33:50 +0000
Source: libjna-java
Source-Version: 3.2.7-3

We believe that the bug you reported is fixed in the latest version of
libjna-java, which is due to be installed in the Debian FTP archive:

  to main/libj/libjna-java/libjna-java-doc_3.2.7-3_all.deb
  to main/libj/libjna-java/libjna-java_3.2.7-3.debian.tar.gz
  to main/libj/libjna-java/libjna-java_3.2.7-3.dsc
  to main/libj/libjna-java/libjna-java_3.2.7-3_amd64.deb

A summary of the changes between this version and the previous one is

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
Andrew Ross <> (supplier of updated libjna-java package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing

Hash: SHA1

Format: 1.8
Date: Wed, 25 May 2011 21:19:02 +0100
Source: libjna-java
Binary: libjna-java libjna-java-doc
Architecture: source amd64 all
Version: 3.2.7-3
Distribution: experimental
Urgency: low
Maintainer: Debian Java maintainers <>
Changed-By: Andrew Ross <>
 libjna-java - Dynamic access of native libraries from Java without JNI
 libjna-java-doc - Dynamic access of native libraries from Java without JNI (documen
Closes: 620122
 libjna-java (3.2.7-3) experimental; urgency=low
   * Seach multiarch paths for libraries (Closes: #620122)
 d563194f72c73d563c5594583fed5e0056703dec 2150 libjna-java_3.2.7-3.dsc
 d593131ecdc957da9e25a86b9522a1cbc3173264 12594 libjna-java_3.2.7-3.debian.tar.gz
 f24987592e77a5502905405389dce26499bc06f6 416126 libjna-java_3.2.7-3_amd64.deb
 3ecf630a61c9de3a8883681d91d043ebb317c102 140774 libjna-java-doc_3.2.7-3_all.deb
 d005df1f0bb03b8f991e51cc84bc0185df48042a69f598d20325be4cdc3ff226 2150 libjna-java_3.2.7-3.dsc
 6a9c709572ffcf22fe96c9c1de823cc3650691161b087db3520702bb1037f4e1 12594 libjna-java_3.2.7-3.debian.tar.gz
 7d76772fc82ea7cf33a8addb1cd69acb4411319d340e7e26d9f7656d89327def 416126 libjna-java_3.2.7-3_amd64.deb
 7909c820f8dc7ae38b5a6717ba95e3484703e5c9aef8627e67ed823da372aacf 140774 libjna-java-doc_3.2.7-3_all.deb
 0694ca8fa744ea65000f7eedbae4c23e 2150 java optional libjna-java_3.2.7-3.dsc
 86f94631fadc5540945db77a1dd3d603 12594 java optional libjna-java_3.2.7-3.debian.tar.gz
 8a415786b855bdc86653b274545d16f2 416126 java optional libjna-java_3.2.7-3_amd64.deb
 67f6edb1e606a57c5cdebcb157561a96 140774 doc optional libjna-java-doc_3.2.7-3_all.deb

Version: GnuPG v1.4.10 (GNU/Linux)


Bug archived. Request was from Debbugs Internal Request <> to (Fri, 15 Jul 2011 07:34:22 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.

Debian bug tracking system administrator <>. Last modified: Sat Apr 19 23:56:15 2014; Machine Name:

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.