Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jna.nosys=true should be default #384

Closed
rednoah opened this issue Nov 17, 2014 · 9 comments
Closed

jna.nosys=true should be default #384

rednoah opened this issue Nov 17, 2014 · 9 comments

Comments

@rednoah
Copy link
Contributor

rednoah commented Nov 17, 2014

Hi,

As more and more Java programs use JNA (FileBot, Processing, etc) and install themselves into the PATH (e.g. FileBot) other arbitrary other tools (e.g. Processing) that don't have -Djna.nosys=true set correctly will break.

Most JNA developer just use it, and think the libraries will be unpacked from the jar, and most don't even know that JNA will actually prefer any jnidispatch.dll that's in the PATH. Only FileBot correctly sets jna.nosys=true while almost any other tool using JNA is oblivious of this issue.

Setting -Djna.nosys=true by default would force the correct default behavior that is assumed by most JNA users anyway already.

Thoughts?

PS: this is probably only an issue on Windows

@rednoah
Copy link
Contributor Author

rednoah commented Dec 7, 2015

Bump?

@twall
Copy link
Contributor

twall commented Dec 9, 2015

The original intent of loading from the system was to allow individual packages to install JNA somewhere and adjust the PATH before launch, reducing the overhead of the automatic unpack. What wasn't accounted for was packages either installing into the system itself (linux distros) or adjusting PATH globally to affect all apps.

@ebourg
Copy link
Contributor

ebourg commented Mar 29, 2016

FYI this issue is being addressed in Debian/Ubuntu, libjnidispatch.so has been renamed to avoid conflicts (only in Debian unstable/testing for now).

@unlimitedsola
Copy link

Any progress?

@matthiasblaesing
Copy link
Member

5.0.0 will be an incompatible release (see CHANGES.md) so now would be a good time for anyone interesting getting the change done. Implementing means not only inverting the decision logik, but also:

  • adding a note to the incompatible changes section in CHANGES.md
  • update the documentation pointing to the attribute

@matthiasblaesing
Copy link
Member

I would appreciate a test of PR #1013, which holds the changes requested here.

@codebutler
Copy link

This change seems to have broken JNA out of the box on Android:

java.lang.UnsatisfiedLinkError: Native library (com/sun/jna/android-x86/libjnidispatch.so) not found in resource path (.)

It works correctly with System.setProperty("jna.nosys", "false").

@matthiasblaesing
Copy link
Member

@codebutler thank you for the heads-up. Indeed android is special in this regard. I pushed a suggested fix as PR #1040.

I rebuild the aar with that change and attach it here (Please rename the file to jna.aar after downloading, github did not like the aar extensions). Please check if that resolves the problem (without having to resort to changing jna.nosys.

jna.aar.zip

@matthiasblaesing
Copy link
Member

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

No branches or pull requests

6 participants