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
Load DLL's from inside JAR #23
Comments
Yes we did not package the DLL. See our instructions in the readme.txt here: https://github.com/melloware/jintellitype/blob/master/readme.txt |
for a better adoption I recommend packaging with the jar. |
Yep I reopened this ticket that is a good idea. Do you have an example library you can point me to that packages them inside the JAR? |
open resource-stream, copy it to a file named System.getProperty("user.home")+"/AppData/LocalLow/jintellitype/jintellitype."+version+".dll" if that does not exist alrady, then use System.load to load it. Should work that way if there are all dependent libraries available on the system. If loading fails, remove and replace the existing extracted dll because it may have been corrupted. Some people also simply extract the dll to the temp folder and register a VM shutdown hook to remove it, but that's inferior because it's slower because it doesn't get cached and always needs to be extracted. Ofc if you really want to do the extraction correctly, you need a blocking lock on the containing folder or open the target file in exclusive mode, the latter could produce a non-critical concurrency failure during the initial extraction when there are two processes trying to achieve the same thing. |
The code failed to load the dll from jar because the jar file on maven central does not contain the dll.
The text was updated successfully, but these errors were encountered: