Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,14 @@ private static SymbolLookup findLibrary(Arena arena) {
try {
var library = System.mapLibraryName("tree-sitter");
return SymbolLookup.libraryLookup(library, arena);
} catch (IllegalArgumentException e) {
return SymbolLookup.loaderLookup();
} catch (IllegalArgumentException ex1) {
try {
System.loadLibrary("tree-sitter");
return SymbolLookup.loaderLookup();
} catch (UnsatisfiedLinkError ex2) {
ex1.addSuppressed(ex2);
throw ex1;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,9 @@
* SymbolLookup.libraryLookup(String, Arena)}.
* </li>
* <li>
* The libraries can be loaded manually by calling
* {@link java.lang.System#loadLibrary(String) System.loadLibrary(String)},
* if the library is installed in {@systemProperty java.library.path},
* or {@link java.lang.System#load(String) System.load(String)}.
* If the libraries are installed in {@systemProperty java.library.path} instead,
* they will be loaded automatically by {@link java.lang.foreign.SymbolLookup#loaderLookup()
* SymbolLookup.loaderLookup()}.
* </li>
* <li>
* The libraries can be loaded manually by registering a custom implementation of
Expand Down
Loading