File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed
src/main/java/org/purejava/linux Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -11,4 +11,8 @@ public static MemorySegment ALLOCATE_FOR(String str) {
11
11
public static MemorySegment ALLOCATE_CALLBACK_FOR (GCallback cb , MemorySession session ) {
12
12
return GCallback .allocate (cb , session );
13
13
}
14
+
15
+ public static boolean isLoadedNativeLib () {
16
+ return RuntimeHelper .isLoaded ();
17
+ }
14
18
}
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ private RuntimeHelper() {}
18
18
private final static ClassLoader LOADER = RuntimeHelper .class .getClassLoader ();
19
19
private final static MethodHandles .Lookup MH_LOOKUP = MethodHandles .lookup ();
20
20
private final static SymbolLookup SYMBOL_LOOKUP ;
21
+ private static boolean isLoaded = false ;
21
22
private static final Logger LOG = LoggerFactory .getLogger (RuntimeHelper .class );
22
23
23
24
final static SegmentAllocator CONSTANT_ALLOCATOR =
@@ -26,6 +27,7 @@ private RuntimeHelper() {}
26
27
static {
27
28
try {
28
29
System .loadLibrary ("appindicator3" );
30
+ isLoaded = true ;
29
31
} catch (UnsatisfiedLinkError e ) {
30
32
LOG .error ("Native code library failed to load.\n " , e );
31
33
}
@@ -221,4 +223,9 @@ private MemoryLayout variadicLayout(Class<?> c) {
221
223
}
222
224
}
223
225
}
226
+
227
+ // Getter
228
+ public static boolean isLoaded () {
229
+ return isLoaded ;
230
+ }
224
231
}
You can’t perform that action at this time.
0 commit comments