Package: release.debian.org
Severity: normal
User: release.debian....@packages.debian.org
Usertags: unblock

Hi,

Please unblock package javatools

Javatools contains the binary package jarwrapper which in turn sets up
binfmt-misc to run executable jar files using the installed java
runtime. It was discovered in

https://bugs.debian.org/764630

that jarwrapper was not able to run applications (e.g. dicomscope)
that depend on multiarch JNI libraries. The issue was fixed in 0.48 by
improving the detection of 32bit and 64bit Java virtual machines and
by starting the current JVM with an additional parameter
(-Djava.library.path) that contains all possible JNI multiarch paths.

Please find attached the debdiff against the version of javatools in
testing.

unblock javatools/0.48

Regards,

Markus
diff -Nru javatools-0.47/debian/changelog javatools-0.48/debian/changelog
--- javatools-0.47/debian/changelog	2014-09-10 13:42:21.000000000 -0700
+++ javatools-0.48/debian/changelog	2014-12-11 22:44:41.000000000 -0800
@@ -1,3 +1,16 @@
+javatools (0.48) unstable; urgency=medium
+
+  * Team upload.
+  * jarwrapper: Add MULTIARCH_LIBRARY_PATH variables for 32bit and 64bit arches
+    which contain all known multiarch jni library paths and use this as
+    value for -Djava.library.path depending on the JVM that is used to
+    launch the application. Add an additional check for the GIJ bytecode
+    interpreter and let it handle the library path by itself.
+    This ensures that all JVM will find the corresponding libraries correctly.
+    (Closes: #764630)
+
+ -- Markus Koschany <a...@gambaru.de>  Fri, 05 Dec 2014 10:38:23 +0100
+
 javatools (0.47) unstable; urgency=medium
 
   * Team upload.
diff -Nru javatools-0.47/jarwrapper javatools-0.48/jarwrapper
--- javatools-0.47/jarwrapper	2014-09-10 12:33:53.000000000 -0700
+++ javatools-0.48/jarwrapper	2014-12-11 22:44:41.000000000 -0800
@@ -19,7 +19,7 @@
 JAVAOPTS="$(perl -0nE 's{\r?\n\s}{}gsm; print $1 if m{^Debian-Java-Parameters:\s*([^\r\n]+)}m;' "$TEMP/META-INF/MANIFEST.MF")"
 rm -rf "$TEMP"
 
-for i in $NEW_JAVA_HOMES; do 
+for i in $NEW_JAVA_HOMES; do
    if [ -x "$i/bin/java" ]; then
       JAVA="$i/bin/java"
       JAVA_HOME="$i"
@@ -33,9 +33,25 @@
    JAVA=java
 fi
 
+MULTIARCH_LIBRARY_PATH_32BIT="/usr/lib/jni:/usr/lib/arm-linux-gnueabi/jni:/usr/lib/arm-linux-gnueabihf/jni:/usr/lib/i386-gnu/jni:/usr/lib/i386-linux-gnu/jni:/usr/lib/i386-kfreebsd-gnu/jni:/usr/lib/mips-linux-gnu/jni:/usr/lib/mipsel-linux-gnu/jni:/usr/lib/powerpc-linux-gnu/jni:/usr/lib/powerpc-linux-gnuspe/jni:/usr/lib/sparc-linux-gnu/jni:/usr/lib/x86_64-linux-gnux32/jni:/usr/lib/hppa-linux-gnu/jni:/usr/lib/sh4-linux-gnu/jni:/usr/lib/m68k-linux-gnu/jni"
+
+MULTIARCH_LIBRARY_PATH_64BIT="/usr/lib/jni:/usr/lib/alpha-linux-gnu/jni:/usr/lib/x86_64-linux-gnu/jni:/usr/lib/aarch64-linux-gnu/jni:/usr/lib/x86_64-kfreebsd-gnu/jni:/usr/lib/powerpc64-linux-gnu/jni:/usr/lib/powerpc64le-linux-gnu/jni:/usr/lib/s390x-linux-gnu/jni:/usr/lib/sparc64-linux-gnu/jni"
+
 if which "$JAVA" >/dev/null 2>&1; then
-	export LD_LIBRARY_PATH=/usr/lib/jni 
-	exec $JAVA $JAVAOPTS -Djava.library.path=/usr/lib/jni -jar "$JAR" "$@"
+    if java --version 2>&1 | grep "GNU libgcj" > /dev/null; then
+        # Let GNU gij handle the library path by itself
+        export LD_LIBRARY_PATH=/usr/lib/jni
+        exec $JAVA $JAVAOPTS -jar "$JAR" "$@"
+    fi
+    if java -d32 2>&1 | grep "does not support" > /dev/null; then
+        # 64bit
+        export LD_LIBRARY_PATH=$MULTIARCH_LIBRARY_PATH_64BIT
+        exec $JAVA $JAVAOPTS -Djava.library.path=$MULTIARCH_LIBRARY_PATH_64BIT -jar "$JAR" "$@"
+    else
+        # 32bit
+        export LD_LIBRARY_PATH=$MULTIARCH_LIBRARY_PATH_32BIT
+        exec $JAVA $JAVAOPTS -Djava.library.path=$MULTIARCH_LIBRARY_PATH_32BIT -jar "$JAR" "$@"
+    fi
 else
-	echo "In order to run Java programs you must install a compatible JRE. If you don't know what JRE you need, default-jre is probably a good bet"
+    echo "In order to run Java programs you must install a compatible JRE. If you don't know what JRE you need, default-jre is probably a good bet"
 fi

Reply via email to