[Debian-med-packaging] Bug#740439: imagej: fails to start: No JVM found to run ImageJ

Florian Kulzer debian-bugs at florian-kulzer.eu
Sat Mar 1 21:39:36 UTC 2014


Hi Andreas,

On Sat, Mar 01, 2014 at 18:02:03 +0100, Andreas Tille wrote:
> On Sat, Mar 01, 2014 at 03:47:52PM +0100, Florian Kulzer wrote:
> > I noticed that ImageJ will no longer start on my fully up-to-date
> > sid/amd64:
> > 
> > $ imagej
> > Open other images in this ImageJ panel as follows:
> >   imagej -p 1 <image1> [<image2> ... <imageN>]
> > 
> > No JVM found to run ImageJ
> 
> While I have no idea how this might happen it could help if
> you do
> 
>    cp /usr/bin/imagej /tmp
>    # add 'set -x' in the second line
>    /tmp/imagej
> 
> This should give some better hints which might enable us tracking
> down the problem.

Thanks a lot for your fast response and your suggestion; I think I have
found the problem now: The command to set JAVA_HOME in the script,

  JAVA_HOME=$(/usr/sbin/update-java-alternatives -l | sort | tail -1 | cut -d' ' -f 3)

returns an empty string if gcj-4.8-jre-headless is installed:

  $ /usr/sbin/update-java-alternatives -l | sort
  java-1.6.0-openjdk-amd64 1061 /usr/lib/jvm/java-1.6.0-openjdk-amd64
  java-1.7.0-openjdk-amd64 1071 /usr/lib/jvm/java-1.7.0-openjdk-amd64
  java-gcj-4.8 /usr/lib/jvm/java-gcj-4.8

There are only two fields in the java-gcj-4.8 line; I cannot judge if
that is normal. In any case, ImageJ does not seem to work with
java-gcj-4.8; when run with JAVA_HOME="/usr/lib/jvm/java-gcj-4.8" it
crashes immediately with an AWT toolkit error.

I can avoid the startup problem if I change the script so that it
ignores non-jdk lines, for example:

  JAVA_HOME=$(/usr/sbin/update-java-alternatives -l | awk '/jdk/{print $3}' | sort | tail -1)

If I remove gcj-4.8-jre-headless then ImageJ works with the original
startup script.

Best regards,

  Florian



More information about the Debian-med-packaging mailing list