Issue
While looking for a way for my Java project to load library binaries that are packed with the project, I see several people stating things like:
before you can use the DLLs you need to actually extract these from the JAR and dump these on the hard disk somewhere otherwise you won't be able to load these
Is this statement true? And why?
Solution
DLL (dynamic link libraries) are operating system specific. The operating system needs to be able to directly find the files in order to load them. A jar file is essentially a zip file and the operating system does not go hunting inside of zip/jar files to find DLLs.
In order for the operating system to find a DLL it needs to be accessible directly on the file system, and also in the DLL path for the OS.
Note that jars are Java specific entities, and Java is distinct from the operating system. By depending on an OS-specific DLL (or .o file in Linux) you are restricting your program to work on operating systems compatible with the library - even the bitness (32bit or 64bit) would matter for a DLL.
That being said, if you do need to include and use DLLs, then you'll need some kind of installation procedure or instructions to get the files in place before being able to run.
Answered By - Always Learning Answer Checked By - David Marino (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.