gary-rowe / hid4java

A cross-platform Java Native Access (JNA) wrapper for the libusb/hidapi library. Works out of the box on Windows/Mac/Linux.
MIT License
229 stars 71 forks source link

Added libraries and auto-loading based on OS #45

Closed vrbadev closed 8 years ago

vrbadev commented 8 years ago

Just for being able to use only this JAR file and don't have to care about compiling libraries specific for OS. Includes auto-extraction of correct native lib from inside JAR into temp location and auto-loading of the extracted hidapi library.

gary-rowe commented 8 years ago

Thanks for this pull request, but aren't the native libraries already included in the final project through src/main/resources?

andyrozman commented 8 years ago

Yes they are, and they are autoloaded if found by jna library (versions 3.x and later do this automatically). I am actually not sure what happens if system requires natives not included in jar. Gary did you test this and determined how this is done? Andy

On Fri, Aug 19, 2016, 13:05 Gary Rowe notifications@github.com wrote:

Thanks for this pull request, but aren't the native libraries already included in the final project through src/main/resources?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/gary-rowe/hid4java/pull/45#issuecomment-240990551, or mute the thread https://github.com/notifications/unsubscribe-auth/AFPs5VZj8ZKoJjzXIrAuYZjfzhujdXk8ks5qhY3dgaJpZM4JoRDS .

gary-rowe commented 8 years ago

Hi Andy. Essentially failure to load an appropriate native library results in a failed start for the API and you get an exception. This has been seen in a few Linux variants but most OSes are covered. I'm relying on people using the library to offer up feedback on missing libraries so I can fill out more.

Given that these libraries are present I don't think this pull request is required so I'll close it now. Happy to reopen if there's a problem.