本文整理了Java中com.sun.jna.Native.open()
方法的一些代码示例,展示了Native.open()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Native.open()
方法的具体详情如下:
包路径:com.sun.jna.Native
类名称:Native
方法名:open
[英]Open the requested native library with the specified platform-specific otions.
[中]使用指定的特定于平台的选项打开请求的本机库。
代码示例来源:origin: net.java.dev.jna/jna
/** Open the requested native library with the specified platform-specific
* otions.
*/
static native long open(String name, int flags);
代码示例来源:origin: net.java.dev.jna/jna
library = new NativeLibrary("<process>", null, Native.open(null, openFlags(options)), options);
代码示例来源:origin: net.java.dev.jna/jna
handle = Native.open(libraryPath, openFlags);
} catch(UnsatisfiedLinkError e) {
libraryPath = findLibraryPath(libraryName, searchPath);
LOG.log(DEBUG_LOAD_LEVEL, "Trying " + libraryPath);
handle = Native.open(libraryPath, openFlags);
if (handle == 0) {
throw new UnsatisfiedLinkError("Failed to load library '" + libraryName + "'");
LOG.log(DEBUG_LOAD_LEVEL, "Preload (via System.loadLibrary) " + libraryName);
System.loadLibrary(libraryName);
handle = Native.open(libraryPath, openFlags);
LOG.log(DEBUG_LOAD_LEVEL, "Trying " + libraryPath);
try {
handle = Native.open(libraryPath, openFlags);
try {
LOG.log(DEBUG_LOAD_LEVEL, "Trying " + libraryPath);
handle = Native.open(libraryPath, openFlags);
LOG.log(DEBUG_LOAD_LEVEL, "Trying " + libraryPath);
try {
handle = Native.open(libraryPath, openFlags);
} catch(UnsatisfiedLinkError e2) {
LOG.log(DEBUG_LOAD_LEVEL, "Loading failed with message: " + e2.getMessage());
File embedded = Native.extractFromResourcePath(libraryName, (ClassLoader)options.get(Library.OPTION_CLASSLOADER));
try {
代码示例来源:origin: org.elasticsearch/jna
/** Open the requested native library with the specified platform-specific
* otions.
*/
static native long open(String name, int flags);
代码示例来源:origin: org.elasticsearch/jna
library = new NativeLibrary("<process>", null, Native.open(null, openFlags(options)), options);
代码示例来源:origin: org.elasticsearch/jna
System.out.println("Trying " + libraryPath);
handle = Native.open(libraryPath, openFlags);
} catch(UnsatisfiedLinkError e) {
System.out.println("Trying " + libraryPath);
handle = Native.open(libraryPath, openFlags);
if (handle == 0) {
throw new UnsatisfiedLinkError("Failed to load library '" + libraryName + "'");
handle = Native.open(libraryPath, openFlags);
handle = Native.open(libraryPath, openFlags);
System.out.println("Trying " + libraryPath);
handle = Native.open(libraryPath, openFlags);
handle = Native.open(libraryPath, openFlags);
} catch(UnsatisfiedLinkError e2) {
e = e2;
File embedded = Native.extractFromResourcePath(libraryName, (ClassLoader)options.get(Library.OPTION_CLASSLOADER));
try {
handle = Native.open(embedded.getAbsolutePath(), openFlags);
libraryPath = embedded.getAbsolutePath();
} finally {
内容来源于网络,如有侵权,请联系作者删除!