Java中的System.load()和System.loadLibrary之间的区别 [英] Difference between System.load() and System.loadLibrary in Java

查看:597
本文介绍了Java中的System.load()和System.loadLibrary之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

System.load() System.loadLibrary()

我想加载一个库,但我不想添加环境变量的路径。
这些中的任何一个都有帮助吗?

I want to load a library but I don't want to add the path to environment variables. Will any one of these help?

推荐答案

API文档中存在差异。 System.loadLibrary(String libname)允许您从默认路径加载 - Java库路径。

The difference is there in the API documentation. System.loadLibrary(String libname) lets you load from the default path -- The Java library path.

其他 System.load(String filename)允许您从绝对路径加载它,您必须将其指定为文件名。

The other System.load(String filename) lets you load it from an absolute path, which you must specify as your filename.

如果你不想弄乱你 java.library.path 环境变量,你应该使用 System.load()

If you don't want to mess with you java.library.path environment variable, you should use System.load()

这篇关于Java中的System.load()和System.loadLibrary之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆