You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public void initTray() {
try (var arena = Arena.ofConfined()) {
var arenaAuto = Arena.ofAuto();
var indicator = AppIndicator.newIndicator("example-simple-client",
"indicator-message",
APP_INDICATOR_CATEGORY_APPLICATION_STATUS());
var gtkSeparator = Gtk.newMenuItem();
var gtkMenu = Gtk.newMenu();
var gtkSubmenu = Gtk.newMenu();
var gtkMenuItem = Gtk.newMenuItem();
Gtk.menuItemSetLabel(gtkMenuItem, "More");
var gtkSMenuItem = Gtk.newMenuItem();
Gtk.menuItemSetLabel(gtkSMenuItem, "Change icon");
var gtkSMenuItem1 = Gtk.newMenuItem();
Gtk.menuItemSetLabel(gtkSMenuItem1, "Quit");
Gtk.menuShellAppend(gtkSubmenu, gtkSMenuItem);
Gtk.menuShellAppend(gtkSubmenu, gtkSeparator);
Gtk.menuShellAppend(gtkSubmenu, gtkSMenuItem1);
Gtk.menuItemSetSubmenu(gtkMenuItem, gtkSubmenu);
// GObject.signalConnectObject(gtkSMenuItem1, "activate", GCallback.allocate(new QuitCallback(), arenaAuto), gtkMenu, 0);
// GObject.signalConnectObject(gtkSMenuItem, "activate", GCallback.allocate(new ChangeIconCallback(indicator), arenaAuto), gtkMenu, 0);
Gtk.menuShellAppend(gtkMenu, gtkMenuItem);
Gtk.widgetShowAll(gtkMenu);
AppIndicator.setMenu(indicator, gtkMenu);
AppIndicator.setAttentionIcon(indicator, "indicator-messages-new");
AppIndicator.setStatus(indicator, APP_INDICATOR_STATUS_ACTIVE());
}
}
Expected Behavior
tray icon working
Actual Behavior
exception is thrown
Reproducibility
Always
Relevant Log Output
Exception in Application start method
Exception in thread "main" java.lang.RuntimeException: Exception in Application start method
at javafx.graphics@23/com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:893)
at javafx.graphics@23/com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:196)
at java.base/java.lang.Thread.run(Thread.java:1575)
Caused by: java.lang.UnsatisfiedLinkError: unresolved symbol: app_indicator_new
at [email protected]/org.purejava.appindicator.app_indicator_h_21.lambda$findOrThrow$0(app_indicator_h_21.java:33)
at java.base/java.util.Optional.orElseThrow(Optional.java:403)
at [email protected]/org.purejava.appindicator.app_indicator_h_21.findOrThrow(app_indicator_h_21.java:33)
at [email protected]/org.purejava.appindicator.app_indicator_h_1$app_indicator_new.<clinit>(app_indicator_h_1.java:1467)
at [email protected]/org.purejava.appindicator.app_indicator_h_1.app_indicator_new(app_indicator_h_1.java:1496)
at [email protected]/org.purejava.appindicator.AppIndicator.newIndicator(AppIndicator.java:81)
at org.dpsoftware/org.dpsoftware.gui.TrayIconManager.initTray(TrayIconManager.java:242)
at org.dpsoftware/org.dpsoftware.FireflyLuciferin.start(FireflyLuciferin.java:261)
at javafx.graphics@23/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:839)
at javafx.graphics@23/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:483)
at javafx.graphics@23/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:456)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
at javafx.graphics@23/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:455)
at javafx.graphics@23/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at javafx.graphics@23/com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
at javafx.graphics@23/com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$10(GtkApplication.java:264)
... 1 more
Anything else?
am I doing something wrong?
The text was updated successfully, but these errors were encountered:
thanks for bringing this up. No, you are not doing anything wrong. It is unable to load the libayatana-appindicator-gtk3 shared library, although you have it installed. That leads to the java.lang.UnsatisfiedLinkError you see.
I looked into this and noticed, that Fedora has a different layout to store its 64bit libraries. They are located in /usr/lib64, not in /usr/lib or a path mentioned in /etc/ld.so.conf.d/, like other distributions like Arch Linux or the Debian family handle this.
I need to fix this in these Java bindings by adding /usr/lib64 to the library search path on library loading and create a new release of the bindings containing the fix.
As a workaround, you might consider to symlink the installed library like ln -s /usr/lib64/libayatana-appindicator3.so.1 /usr/lib/.
purejava
changed the title
unresolved symbol: app_indicator_new
unresolved symbol: app_indicator_new on Fedora
Nov 9, 2024
Please agree to the following
Summary
Simple code sample on the wiki throws an exception.
What software is involved?
Fedora 41
OpenJDK 23
Classifier
libappindicator-full
Steps to Reproduce
I added this code to my Java FX app.
Expected Behavior
tray icon working
Actual Behavior
exception is thrown
Reproducibility
Always
Relevant Log Output
Anything else?
am I doing something wrong?
The text was updated successfully, but these errors were encountered: