Broken Fiji in Ubuntu 20.04 with openjdk 8u252

I’ve upgraded a laptop to Ubuntu 20.04, openjdk 8u25 and, when Fiji launches, its menus or toolbar aren’t responsive: it’s like the UI is frozen. Resizing the Fiji window results in lack of repainting, indicative of a locked or stuck event dispatch thread. Any known workarounds?

On the other hand, running

Fiji.app$ java -jar jars/ij-1.52p.jar

… results in a working ImageJ.

The issue seems specific of Fiji.

The jconsole shows the AWT-EventQueue-1 thread is blocked:

Name: AWT-EventQueue-1
State: BLOCKED on java.awt.Component$AWTTreeLock@1bde9d17 owned by: main
Total blocked: 10  Total waited: 61

Stack trace: 
java.awt.Container.dispatchEventImpl(Container.java:2300)
java.awt.Component.dispatchEvent(Component.java:4711)
java.awt.EventQueue.dispatchEventImpl(EventQueue.java:760)
java.awt.EventQueue.access$500(EventQueue.java:97)
java.awt.EventQueue$3.run(EventQueue.java:709)
java.awt.EventQueue$3.run(EventQueue.java:703)
java.security.AccessController.doPrivileged(Native Method)
java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:84)
java.awt.EventQueue$4.run(EventQueue.java:733)
java.awt.EventQueue$4.run(EventQueue.java:731)
java.security.AccessController.doPrivileged(Native Method)
java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
java.awt.EventQueue.dispatchEvent(EventQueue.java:730)
org.GNOME.Accessibility.AtkWrapper$6.dispatchEvent(AtkWrapper.java:705)
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

Hi @ctrueden, I’ve run into a strange workaround: launch Fiji like:

$ ./ImageJ-linux64 --ij2

… even though ImageJ1 UI actually loads rather than ImageJ2’s, and the menus and UI work.

The --ij1 also works, but of course it lacks a Script Editor and other context injection-dependent plugins.

Update: --ij2 can also fail, resulting in a frozen UI. There may be a race condition of some kind. Could you remind me of how to manually create a context so that I can pass it to the TextEditor to open it? The automatic context injection isn’t available when invoking the TextEditor from a scripting interpreter.

openjdk 8u25

That’s a super old version of Java! Do you mean 8u252? That’s the newest OpenJDK 8 as of this writing.

What about the version of Java bundled with the Fiji tarball? That one is known-to-work on other Linuxes, so worth testing on Ubuntu 20.04, to narrow down if it’s a bug in Java versus lower-level operating system configuration or components.

Context ctx = new Context();

Indeed I meant java 8u252 (it’s correct in the title).

My Fiji.app/java/linux-amd64 has been empty for several years, haven’t tried downloading a fresh fiji. So I’ve done so now, and your intutition is right: java 8u172 (as bundled in the linux amd64 Fiji.app) works well consistently: no freezes.

(And thanks for the reminder on the Context!)

For what’s worth, I’ve put up a bug report for Ubuntu 20.04: https://bugs.launchpad.net/ubuntu/+source/openjdk-8/+bug/1880246

1 Like

Thanks a lot for filing that!