I am currently working on a larger project but was able to pin point my problem to one line:
java.awt.Desktop.getDesktop().browse(new URI("https://google.com"));
When attempting to open a website using the java.awt.Desktop class in Java, such as Google, the following GTK warning is printed to my console twice. How do I solve or suppress this warning?
[146880, Main Thread] WARNING: GTK+ module /snap/firefox/4090/gnome-platform/usr/lib/gtk-2.0/modules/libcanberra-gtk-module.so cannot be loaded.
GTK+ 2.x symbols detected. Using GTK+ 2.x and GTK+ 3 in the same process is not supported.: 'glib warning', file /build/firefox/parts/firefox/build/toolkit/xre/nsSigHandlers.cpp:187
(firefox:146880): Gtk-WARNING **: 21:05:50.793: GTK+ module /snap/firefox/4090/gnome-platform/usr/lib/gtk-2.0/modules/libcanberra-gtk-module.so cannot be loaded.
GTK+ 2.x symbols detected. Using GTK+ 2.x and GTK+ 3 in the same process is not supported.
Gtk-Message: 21:05:50.793: Failed to load module "canberra-gtk-module"
System.setErr(new PrintStream(new FileOutputStream("/dev/null")));
, but this did not resolve the issue.Ubuntu 22.04.4 LTS Firefox 124.0.2 (64-bit)
Any idea is appreciated.
Like mentioned by yvs2014 the message only occurs when installing Firefox via snap, like in my case, and probably when installing via flatpak. To solve the problem simply follow the official download provided by Mozilla and use .deb
.
Caution: Remember to back up your settings, passwords, profiles, etc. before reinstalling.