File tree Expand file tree Collapse file tree 2 files changed +11
-6
lines changed
src/main/java/io/github/treesitter/jtreesitter Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -28,8 +28,14 @@ private static SymbolLookup findLibrary(Arena arena) {
28
28
try {
29
29
var library = System .mapLibraryName ("tree-sitter" );
30
30
return SymbolLookup .libraryLookup (library , arena );
31
- } catch (IllegalArgumentException e ) {
32
- return SymbolLookup .loaderLookup ();
31
+ } catch (IllegalArgumentException ex1 ) {
32
+ try {
33
+ System .loadLibrary ("tree-sitter" );
34
+ return SymbolLookup .loaderLookup ();
35
+ } catch (UnsatisfiedLinkError ex2 ) {
36
+ ex1 .addSuppressed (ex2 );
37
+ throw ex1 ;
38
+ }
33
39
}
34
40
}
35
41
}
Original file line number Diff line number Diff line change 43
43
* SymbolLookup.libraryLookup(String, Arena)}.
44
44
* </li>
45
45
* <li>
46
- * The libraries can be loaded manually by calling
47
- * {@link java.lang.System#loadLibrary(String) System.loadLibrary(String)},
48
- * if the library is installed in {@systemProperty java.library.path},
49
- * or {@link java.lang.System#load(String) System.load(String)}.
46
+ * If the libraries are installed in {@systemProperty java.library.path} instead,
47
+ * they will be loaded automatically by {@link java.lang.foreign.SymbolLookup#loaderLookup()
48
+ * SymbolLookup.loaderLookup()}.
50
49
* </li>
51
50
* <li>
52
51
* The libraries can be loaded manually by registering a custom implementation of
You can’t perform that action at this time.
0 commit comments