Java中System.load()和System.loadLibrary的区别
System.load()
和 System.loadLibrary()
?
我想加载库,但不想将路径添加到环境变量。 其中任何一项会有帮助吗?
What is the difference between System.load()
and System.loadLibrary()
in java?
I want to load a library but I don't want to add the path to environment variables.
Will any one of these help?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
API 文档中存在差异。
System.loadLibrary(String libname)
允许您从默认路径(Java 库路径)加载。另一个
System.load(String filename)
允许您从绝对路径加载它,您必须将其指定为文件名。如果您不想弄乱
java.library.path
环境变量,则应该使用System.load()
The difference is there in the API documentation.
System.loadLibrary(String libname)
lets you load from the default path -- The Java library path.The other
System.load(String filename)
lets you load it from an absolute path, which you must specify as your filename.If you don't want to mess with you
java.library.path
environment variable, you should useSystem.load()