java-native-access / java-native-access/jna
Support JNI_OnLoad for running static constructors
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 8.9k
- Forks
- 1.7k
- PR merge metrics
- No merged PRs in 30d
Description
The JNI invokes JNI_OnLoad when loading a library. I was surprised that Native.loadLibrary(...) did not invoke JNI_OnLoad in my library (when it is present). Could we mimic the JNI functionality? This is an observable behaviour difference.
I understand that this is not the most natural situation for JNA -- I believe JNA is intended to provide access to existing libraries that are not intended specifically for use with JNI -- but it's mighty useful.
I searched the issues and the JNA users group and can find no mention of this type of feature request.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing Native.loadLibrary and the JNI_OnLoad behavior described in the issue, then compare how JNA currently loads native libraries with JNI expectations. Done means defining and implementing compatible JNI_OnLoad invocation for libraries where it is present, with coverage for the observable behavior difference.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100