ImageJ fails to run - /usr/share/imagej/jni/*: No such file or directory

Bug #471127 reported by Thomas Ibbotson
34
This bug affects 6 people
Affects Status Importance Assigned to Milestone
imagej (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: imagej

When trying to run imagej on a fresh install of Karmic the following error message is produced:

Open other images in this ImageJ panel as follows:
  imagej -p 1 <image1> [<image2> ... <imageN>]

cat: /usr/share/imagej/jni/*: No such file or directory
/usr/bin/imagej: line 418: //bin/java: No such file or directory

which shows 2 problems. The first is the problem I am reporting here. The 2nd can be worked around by setting the JAVA_HOME environment variable appropriately.

imagej:
  Installed: 1.43b-1ubuntu1
  Candidate: 1.43b-1ubuntu1
  Version table:
 *** 1.43b-1ubuntu1 0
        500 http://mirror.ox.ac.uk karmic/universe Packages
        100 /var/lib/dpkg/status

Steps to reproduce:
1. Install imagej: "sudo apt-get install imagej"
2. Run imagej from a command-line: "imagej"

Also if I set the JAVA_HOME variable correctly, I get the following error message:

Open other images in this ImageJ panel as follows:
  imagej -p 1 <image1> [<image2> ... <imageN>]

cat: /usr/share/imagej/jni/*: No such file or directory
Exception in thread "main" java.awt.AWTError: Cannot load AWT toolkit: gnu.java.awt.peer.gtk.GtkToolkit
   at java.awt.Toolkit.getDefaultToolkit(libgcj.so.10)
   at java.awt.Font.tk(libgcj.so.10)
   at java.awt.Font.getPeerFromToolkit(libgcj.so.10)
   at java.awt.Font.<init>(libgcj.so.10)
   at ij.ImageJ.<clinit>(ImageJ.java:75)
   at java.lang.Class.initializeClass(libgcj.so.10)
Caused by: java.lang.UnsatisfiedLinkError: libgtkpeer: libgtkpeer.so: cannot open shared object file: No such file or directory
   at java.lang.Runtime._load(libgcj.so.10)
   at java.lang.Runtime.loadLibrary(libgcj.so.10)
   at java.lang.System.loadLibrary(libgcj.so.10)
   at gnu.java.awt.peer.gtk.GtkToolkit.<clinit>(libgcj.so.10)
   at java.lang.Class.initializeClass(libgcj.so.10)
   at java.lang.Class.forName(libgcj.so.10)
   at java.awt.Toolkit.getDefaultToolkit(libgcj.so.10)
   ...5 more

Revision history for this message
Lucio (lumatemp-nospam) wrote :

Same here. Most important to me is that the graphic frontend does not start at all (in Ubuntu 9.04 it was working)

Revision history for this message
linuxed (linuxed) wrote :

If anyone's looking for a temporary fix to get imagej working in Karmic you can use the following.

sudo gedit /usr/bin/imagej

Copy and paste the following on the 2nd line. Save the file when finished.

# run the program and exit
if [ ! -e "$HOME/.imagej/ij.jar" ] ; then
    if [ ! -e "$HOME/.imagej" ] ; then
        mkdir $HOME/.imagej
        cp -P -R /usr/share/imagej/* $HOME/.imagej
    fi
    cp -P /usr/share/java/ij.jar $HOME/.imagej
fi
java -jar $HOME/.imagej/ij.jar
exit 0

Revision history for this message
blab_blab (blab-blab) wrote :

I had the same issue.

After a while I found:
http://packages.ubuntu.com/karmic/imagej
which made me try to install “java2-runtime” (http://packages.ubuntu.com/karmic/java2-runtime)

I've updated/installed: default-jre, gcj-4.4-jre, gcj-jre and openjdk-6-jre via synaptic (don't ask me why), and luckily ImageJ works fine.

Revision history for this message
rCX (rcx) wrote :

blab_blab's suggestion...

sudo apt-get install default-jre gcj-4.4-jre gcj-jre openjdk-6-jre

...worked perfectly for me in ubuntu 9.10.

Changed in imagej (Ubuntu):
status: New → Confirmed
Revision history for this message
Carnë Draug (carandraug) wrote :

I solved the problem by installing "default-jre" and "gcj-jre". These two will install the other packages mentioned by blab_blab and rCX.

imageJ depencies include "giJ | java2-runtime". Java2-runtime should install the needed packages but it is not present in 9.10 repositories.

Java2-runtime is a "virtual package provided by default-jre, gcj-4.4-jre, gcj-jre, java-gcj-compat, openjdk-6-jre, sun-java6-jre" (I checked in the debian repositories).

description: updated
Revision history for this message
BobC (flymypg) wrote :

Verified 1) problem still exists, and 2) fix recommended by Carnë Draug works.

Revision history for this message
Charles Plessy (plessy) wrote :

Hello everybody,

This is fixed in Lucid since version 1.43l-1, that depends on openjdk-6-jre | java2-runtime.

Have a nice day,

--
Charles Plessy
Debian Med packaging team
http://www.debian.org/devel/debian-med
Tsurumi, Kanagawa, Japan

Revision history for this message
Thomas Ibbotson (thomas-ibbotson) wrote :

As lucid is out now, I'm marking this as Fix Released.

Changed in imagej (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.