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) {
1111 public static MemorySegment ALLOCATE_CALLBACK_FOR (GCallback cb , MemorySession session ) {
1212 return GCallback .allocate (cb , session );
1313 }
14+
15+ public static boolean isLoadedNativeLib () {
16+ return RuntimeHelper .isLoaded ();
17+ }
1418}
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ private RuntimeHelper() {}
1818 private final static ClassLoader LOADER = RuntimeHelper .class .getClassLoader ();
1919 private final static MethodHandles .Lookup MH_LOOKUP = MethodHandles .lookup ();
2020 private final static SymbolLookup SYMBOL_LOOKUP ;
21+ private static boolean isLoaded = false ;
2122 private static final Logger LOG = LoggerFactory .getLogger (RuntimeHelper .class );
2223
2324 final static SegmentAllocator CONSTANT_ALLOCATOR =
@@ -26,6 +27,7 @@ private RuntimeHelper() {}
2627 static {
2728 try {
2829 System .loadLibrary ("appindicator3" );
30+ isLoaded = true ;
2931 } catch (UnsatisfiedLinkError e ) {
3032 LOG .error ("Native code library failed to load.\n " , e );
3133 }
@@ -221,4 +223,9 @@ private MemoryLayout variadicLayout(Class<?> c) {
221223 }
222224 }
223225 }
226+
227+ // Getter
228+ public static boolean isLoaded () {
229+ return isLoaded ;
230+ }
224231}
You can’t perform that action at this time.
0 commit comments