Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@afloren
Copy link
Contributor

@afloren afloren commented Mar 30, 2023

Ensures that the native library path is absolute before loading to avoid java.lang.UnsatisfiedLinkError: Expecting an absolute path of the library.


In my particular case the issue arises when running as part of an application that has java.io.tmpdir set to a relative path which results in the constructed tempDir path being relative. We could alternatively force the tempDir path to be absolute immediately on creation, but forcing the path to be absolute immediately before the call that cares seems more future proof. I'm currently using a custom loader to avoid this issue but I figured I'd contribute in case anyone else hits this edge case.

@afloren
Copy link
Contributor Author

afloren commented Mar 31, 2023

happy to add a test case for the offending tmpdir setting as well though I thought it might be overkill

@afloren
Copy link
Contributor Author

afloren commented Apr 4, 2023

Hey @Mizux thanks for reviewing! I don't think the checks issues are related to the PR content, is there anything you'd like me to do before merging?

@Mizux
Copy link
Collaborator

Mizux commented Apr 5, 2023

Hey @Mizux thanks for reviewing! I don't think the checks issues are related to the PR content, is there anything you'd like me to do before merging?

Yup, as usual our main (aka dev) branch is borken on windows...

To be honest, I just wanted to play with this patch to understand all the implications (e.g. try to use it in a maven Java app to see what's happen, test it in https://github.com/mizux/java-native etc...).
I guess we have to follow plan B -> I'll merge it and revert it if lot of user complains about some path error/loading issue.

Sorry for the delay and thx for the PR.

@Mizux Mizux merged commit ea111e4 into google:main Apr 5, 2023
Mizux added a commit to Mizux/java-native that referenced this pull request Apr 5, 2023
@Mizux Mizux added this to the v9.12 milestone Nov 5, 2024
@Mizux Mizux self-assigned this Mar 3, 2025
Mizux added a commit to Mizux/java-native that referenced this pull request Oct 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants