Skip to content

Commit 770cc5f

Browse files
committed
Load ayatana-appindicator3 preferably
1 parent 70bd53c commit 770cc5f

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

src/main/java/org/purejava/linux/RuntimeHelper.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,17 @@ private RuntimeHelper() {}
2626

2727
static {
2828
try {
29-
System.loadLibrary("appindicator3");
29+
System.loadLibrary("ayatana-appindicator3");
30+
LOG.debug("Native code library ayatana-appindicator3 successfully loaded");
3031
isLoaded = true;
3132
} catch (UnsatisfiedLinkError e) {
3233
LOG.error("Native code library failed to load.\n", e);
34+
try {
35+
System.loadLibrary("appindicator3");
36+
LOG.debug("Native code library appindicator3 successfully loaded");
37+
} catch (UnsatisfiedLinkError e2) {
38+
LOG.error("Native code library failed to load.\n", e2);
39+
}
3340
}
3441
SymbolLookup loaderLookup = SymbolLookup.loaderLookup();
3542
SYMBOL_LOOKUP = name -> loaderLookup.lookup(name).or(() -> LINKER.defaultLookup().lookup(name));

src/test/java/org/purejava/linux/AppIndicatorTest.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,16 @@ class AppIndicatorTest {
1616
@EnabledOnOs(OS.LINUX)
1717
public void shouldHaveNoErrors() {
1818
try {
19-
System.loadLibrary("appindicator3");
19+
System.loadLibrary("ayatana-appindicator3");
20+
LOG.debug("Native code library ayatana-appindicator3 successfully loaded");
2021
} catch (UnsatisfiedLinkError e) {
2122
LOG.error("Native code library failed to load.\n", e);
23+
try {
24+
System.loadLibrary("appindicator3");
25+
LOG.debug("Native code library appindicator3 successfully loaded");
26+
} catch (UnsatisfiedLinkError e2) {
27+
LOG.error("Native code library failed to load.\n", e2);
28+
}
2229
}
2330
}
2431
}

0 commit comments

Comments
 (0)