Package: imagej
Version: 1.43g-1
Severity: important
Tags: patch

When java-gcj-compat is the only java version installed on the system the 
application will not run. It fails with message /usr/bin/imagej: line 420: 
//bin/java: No such file or directory. This is because of the JAVA_HOME hack 
introduced inversion 1.43b-1.

When the correct path is specified it still will not run. It crashes with error:
(lucid32)ma...@laptop:~/dev/submitted/imagej$ imagej     
Open other images in this ImageJ panel as follows:       
  imagej -p 1 <image1> [<image2> ... <imageN>]           

Exception in thread "main" java.lang.NullPointerException
   at java.awt.Component.setDropTarget(libgcj.so.10)     
   at ij.plugin.DragAndDrop.run(DragAndDrop.java:28)     
   at ij.IJ.runPlugIn(IJ.java:152)                       
   at ij.IJ.runPlugIn(IJ.java:135)                       
   at ij.ImageJ.<init>(ImageJ.java:184)                  
   at ij.ImageJ.main(ImageJ.java:554)        

These errors can be corrected by depending on openjdk-6-jre and reverting the 
JAVA_HOME hack to what it used to be. I have attached a patch to correct these 
problems.


-- System Information:
Debian Release: squeeze/sid
  APT prefers karmic-updates
  APT policy: (500, 'karmic-updates'), (500, 'karmic-security'), (500, 
'karmic-proposed'), (500, 'karmic-backports'), (500, 'karmic')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.31-15-generic (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages imagej depends on:
ii  gcj-4.4-jre [java2-r 4.4.1-5ubuntu2      Java runtime environment using GIJ
ii  gcj-jre [java2-runti 4:4.4.1-1ubuntu2    Java runtime environment using GIJ
ii  openjdk-6-jre [java2 6b16-1.6.1-3ubuntu1 OpenJDK Java runtime, using Hotspo
ii  sun-java6-jre [java2 6-15-1              Sun Java(TM) Runtime Environment (

imagej recommends no packages.

Versions of packages imagej suggests:
ii  gcj-4.4-jre-headless [j 4.4.1-5ubuntu2   Java runtime environment using GIJ
ii  gcj-jre-headless [java- 4:4.4.1-1ubuntu2 Java runtime environment using GIJ
ii  gij-4.3 [java-virtual-m 4.3.4-4ubuntu1   The GNU Java bytecode interpreter
ii  sun-java6-jre [java-vir 6-15-1           Sun Java(TM) Runtime Environment (

-- no debconf information
diff -u imagej-1.43k/debian/control imagej-1.43k/debian/control
--- imagej-1.43k/debian/control
+++ imagej-1.43k/debian/control
@@ -13,7 +13,7 @@
 
 Package: imagej
 Architecture: all
-Depends: ${java:Depends}, ${misc:Depends}, java-gcj-compat | java2-runtime,
+Depends: ${java:Depends}, ${misc:Depends}, openjdk-6-jre | java2-runtime
 Suggests: java-virtual-machine
 Description: Image processing program inspired by NIH Image for the Macintosh
  It can display, edit, analyze, process, save and print 8-bit, 16-bit and
diff -u imagej-1.43k/debian/imagej.sh imagej-1.43k/debian/imagej.sh
--- imagej-1.43k/debian/imagej.sh
+++ imagej-1.43k/debian/imagej.sh
@@ -26,9 +26,7 @@
 ##################### DEFINE JAVA_HOME  #####################
 
 if [ -z "$JAVA_HOME" ] ; then
-    # This does not work see #505315
-    # JAVA_HOME=$(/usr/sbin/update-java-alternatives -l | head -1 | cut -d' ' -f 3)
-    JAVA_HOME=$(dirname $(dirname $(dirname $(readlink /etc/alternatives/java))))
+    JAVA_HOME=$(/usr/sbin/update-java-alternatives -l | head -1 | cut -d' ' -f 3)
 fi
 
 ##################### CREATE THE RIGHT ENVIRONMENT #####################

Reply via email to