Unrecognized option: -d64

Bug #1781657 reported by tk
18
This bug affects 4 people
Affects Status Importance Assigned to Milestone
imagej (Debian)
Fix Released
Unknown
imagej (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

I installed imagej (version 1.51q-1) on my Mint 19 machine via Ubuntu bionic repositories.

In its default configuration, imagej cannot be started. If run from the command line, the error reported is:
Open other images in this ImageJ panel as follows:
  imagej -p 1 <image1> [<image2> ... <imageN>]

Unrecognized option: -d64
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

The issue seems to be caused by the new version of the Java, which does not accept -d64 as the same error happens if I call "java -d64":
Unrecognized option: -d64
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

The problem is resolved if I remove the architecture variable in the startup script of imagej (/usr/bin/imagej) at lines 420 and 422. That originally reads:
echo $JAVA_HOME/bin/java ${arch} -mx${mem}m ${jni} ${modules} ij.ImageJ -ijpath ${ij_user_path} -port${count} ${images} ${macrocmd} ${macroargs}

Modified version:
echo $JAVA_HOME/bin/java -mx${mem}m ${jni} ${modules} ij.ImageJ -ijpath ${ij_user_path} -port${count} ${images} ${macrocmd} ${macroargs}

Thank you

Tags: bionic java
tags: added: bionic
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in imagej (Ubuntu):
status: New → Confirmed
Revision history for this message
Sundberg Pauli (susundberg) wrote :

Confirm, happened to me on up-to-date, today on kubuntu.

For suggested work-around works also for me, here is diff:

--- /usr/bin/imagej.orig 2018-08-08 08:58:24.929997867 +0300
+++ /usr/bin/imagej 2018-08-08 08:59:13.774938712 +0300
@@ -418,9 +418,9 @@
 if [ "$JAVA_HOME" ] ; then
     if (( $verbosity > 0 )) ; then
         echo ${modules}
- echo $JAVA_HOME/bin/java ${arch} -mx${mem}m ${jni} ${modules} ij.ImageJ -ijpath ${ij_user_path} -port${count} ${images} ${macrocmd} ${macroargs}
+ echo $JAVA_HOME/bin/java -mx${mem}m ${jni} ${modules} ij.ImageJ -ijpath ${ij_user_path} -port${count} ${images} ${macrocmd} ${macroargs}
     else
- eval $JAVA_HOME/bin/java ${arch} -mx${mem}m ${jni} ${modules} ij.ImageJ -ijpath ${ij_user_path} -port${count} ${images} ${macrocmd} ${macroargs}
+ eval $JAVA_HOME/bin/java -mx${mem}m ${jni} ${modules} ij.ImageJ -ijpath ${ij_user_path} -port${count} ${images} ${macrocmd} ${macroargs}
     fi
 else
     echo "No JVM found to run ImageJ"

Revision history for this message
tk (phenol) wrote :

After the release of a Java update, the above fix is still required. However, one more problem emerged:

Exception in thread "main" java.awt.AWTError: Assistive Technology not found: org.GNOME.Accessibility.AtkWrapper
 at java.desktop/java.awt.Toolkit.newAWTError(Toolkit.java:472)
 at java.desktop/java.awt.Toolkit.fallbackToLoadClassForAT(Toolkit.java:488)
...

This can be fixed by commenting out the below line in /etc/java-11-openjdk/accessibility.properties:
# assistive_technologies=org.GNOME.Accessibility.AtkWrapper

Changed in imagej (Debian):
status: Unknown → Fix Released
Revision history for this message
Dylan Aïssi (daissi) wrote :

Fixed in Disco!

Changed in imagej (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Bram Bouwens (bbouwens) wrote :

Bug is still present in Ubuntu 18.04.3 LTS, using imagej 1.51q-1

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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