-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Setting java.library.path doesn't seem to work #59
Comments
This is a limitation of jextract and the FFM API. See #36 (comment). |
I can think of the following ways to fix this pain point and make
I’d be interested in contributing a fix because fixing this upstream requires building |
Thanks for reopening this issue. Do you have a preference for how to fix this? Patching |
If you are already patching |
That's not possible since the
|
What I'm trying to say is that a Java application or library that uses java-tree-sitter can't set the library search path programmatically.
Here is a clean way to do this: #61 |
I was under the impression Java could set environment variables programmatically like in every other language. |
AFAIK the real problem here is that certain env vars/system properties are read early during JVM startup (before the |
I'm trying to load the tree-sitter native library from a specific directory by setting system property
java.library.path
as advertised here: https://tree-sitter.github.io/java-tree-sitter/io/github/treesitter/jtreesitter/package-summary.htmlHowever, I'm getting the following exception:
TreeSitter.java:58 contains:
Here, initialization of field
SYMBOL_LOOKUP
fails becauseSymbolLookup.libraryLookup(System.mapLibraryName("tree-sitter"), LIBRARY_ARENA)
throws:In other words, this seems to fail long before it tries to load anything from
java.library.path
.Windows 11, java-tree-sitter 0.24.0
The text was updated successfully, but these errors were encountered: