Java Native Access API 是否在本地保存本机库以供执行?
我只是想知道是否有人知道 Java Native Access API 是否会在加载和使用本机库之前或加载和使用本机库时将本机库本地保存到临时位置?
I was just wondering if anyone knew whether the Java Native Access API will locally save the native libraries into a temporary location before or when loading and using native libraries?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不可以。库必须位于操作系统搜索路径上并从那里加载。然而,本机 dll (win) 或 so (linux 等) 必须放置在搜索路径中,例如应用程序的主目录中。可能(不知道)该 dll 包含在 .jar 中,在这种情况下,它被提取到临时文件夹中并从那里链接。
No. Libs have to be on the OS search path and are loaded from there. The native dll (win) or so (linux etc.) however has to be placed in the search path, e.g. in the main directory of your application. It might be (don't know) that the dll is contained in the .jar, in this case it is extracted into the temp folder and linked from there.