Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Newer versions of libgtk-3-0 break JavaFX on linux #31

Open
elevans opened this issue Nov 26, 2024 · 0 comments
Open

Newer versions of libgtk-3-0 break JavaFX on linux #31

elevans opened this issue Nov 26, 2024 · 0 comments

Comments

@elevans
Copy link

elevans commented Nov 26, 2024

On some linux systems (I'm on Ubuntu 24.04 LTS) newer versions of libgtk-3-0 (or perhaps libgtk-4-1) introduce breaking changes for JavaFX. With the current bundled version of Java 8 with Fiji, zulu8.60.0.21, FLIMJ will fail to open with the following exception:

(Fiji Is Just) ImageJ 2.14.0/1.54f; Java 1.8.0_322 [64-bit]; Linux 6.8.0-49-generic; 410MB of 19119MB (2%)
 
java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.RuntimeException: Module threw exception
	at net.imagej.legacy.LegacyService.runLegacyCompatibleCommand(LegacyService.java:308)
	at net.imagej.legacy.DefaultLegacyHooks.interceptRunPlugIn(DefaultLegacyHooks.java:166)
	at ij.IJ.runPlugIn(IJ.java)
	at ij.Executer.runCommand(Executer.java:152)
	at ij.Executer.run(Executer.java:70)
	at java.lang.Thread.run(Thread.java:750)
Caused by: java.util.concurrent.ExecutionException: java.lang.RuntimeException: Module threw exception
	at java.util.concurrent.FutureTask.report(FutureTask.java:122)
	at java.util.concurrent.FutureTask.get(FutureTask.java:192)
	at net.imagej.legacy.LegacyService.runLegacyCompatibleCommand(LegacyService.java:304)
	... 5 more
Caused by: java.lang.RuntimeException: Module threw exception
	at org.scijava.module.ModuleRunner.call(ModuleRunner.java:128)
	at org.scijava.module.ModuleRunner.call(ModuleRunner.java:64)
	at org.scijava.thread.DefaultThreadService.lambda$wrap$2(DefaultThreadService.java:247)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	... 1 more
Caused by: java.lang.UnsupportedOperationException: Internal Error
	at com.sun.glass.ui.gtk.GtkApplication.lambda$new$5(GtkApplication.java:158)
	at java.security.AccessController.doPrivileged(Native Method)
	at com.sun.glass.ui.gtk.GtkApplication.<init>(GtkApplication.java:140)
	at com.sun.glass.ui.gtk.GtkPlatformFactory.createApplication(GtkPlatformFactory.java:41)
	at com.sun.glass.ui.Application.run(Application.java:147)
	at com.sun.javafx.tk.quantum.QuantumToolkit.startup(QuantumToolkit.java:279)
	at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:211)
	at javafx.embed.swing.JFXPanel.initFx(JFXPanel.java:249)
	at javafx.embed.swing.JFXPanel.<init>(JFXPanel.java:264)
	at flimlib.flimj.ui.FLIMJCommand.run(FLIMJCommand.java:71)
	at org.scijava.command.CommandModule.run(CommandModule.java:196)
	at org.scijava.module.ModuleRunner.run(ModuleRunner.java:165)
	at org.scijava.module.ModuleRunner.call(ModuleRunner.java:125)
	... 6 more

There are two workarounds you can use to get this working:

  1. Downgrade your version of libgtk-3-0 or find a computer with an older version of Ubuntu. We found that Ubuntu 22.04.5 LTS was able to launch FLIMJ while 24.04 LTS did not. I didn't specifically test downgrading my libgtk-3-0 but it seems at least version 3.24.33-1ubuntu2.2 works and version 3.24.38-5ubuntu1 does not.
  2. Update to the latest zulu JDK+FX (download the JDK+FX zulu Java 8 package and replace the java in your Fiji.app/java folder) and run Fiji with the -Djavafx.allowjs=true flag. Like so:
$ ./ImageJ-linux64 -Djavafx.allowjs=true

Thanks @ctrueden for helping figure out what was going on here!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant