java.lang.Runtime.load()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(8.8k)|赞(0)|评价(0)|浏览(176)

本文整理了Java中java.lang.Runtime.load()方法的一些代码示例,展示了Runtime.load()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Runtime.load()方法的具体详情如下:
包路径:java.lang.Runtime
类名称:Runtime
方法名:load

Runtime.load介绍

[英]Loads and links the dynamic library that is identified through the specified path. This method is similar to #loadLibrary(String), but it accepts a full path specification whereas loadLibrary just accepts the name of the library to load.
[中]加载并链接通过指定路径标识的动态库。此方法类似于#loadLibrary(String),但它接受完整路径规范,而loadLibrary只接受要加载的库的名称。

代码示例

代码示例来源:origin: robovm/robovm

/**
 * Loads and links the dynamic library that is identified through the
 * specified path. This method is similar to {@link #loadLibrary(String)},
 * but it accepts a full path specification whereas {@code loadLibrary} just
 * accepts the name of the library to load.
 *
 * @param pathName
 *            the path of the file to be loaded.
 */
public static void load(String pathName) {
  Runtime.getRuntime().load(pathName, VMStack.getCallingClassLoader());
}

代码示例来源:origin: robovm/robovm

/**
 * Loads and links the dynamic library that is identified through the
 * specified path. This method is similar to {@link #loadLibrary(String)},
 * but it accepts a full path specification whereas {@code loadLibrary} just
 * accepts the name of the library to load.
 *
 * @param pathName
 *            the absolute (platform dependent) path to the library to load.
 * @throws UnsatisfiedLinkError
 *             if the library can not be loaded.
 */
public void load(String pathName) {
  load(pathName, VMStack.getCallingClassLoader());
}

代码示例来源:origin: EvoSuite/evosuite

public static void load(Runtime runtime, String filename) {
  //load0(Reflection.getCallerClass(), filename);
  runtime.load(filename);  // we need to load the actuall stuff
}

代码示例来源:origin: com.jtransc/jtransc-rt

public static void load(String filename) {
  Runtime.getRuntime().load(filename);
}

代码示例来源:origin: MobiVM/robovm

/**
 * Loads and links the dynamic library that is identified through the
 * specified path. This method is similar to {@link #loadLibrary(String)},
 * but it accepts a full path specification whereas {@code loadLibrary} just
 * accepts the name of the library to load.
 *
 * @param pathName
 *            the path of the file to be loaded.
 */
public static void load(String pathName) {
  Runtime.getRuntime().load(pathName, VMStack.getCallingClassLoader());
}

代码示例来源:origin: FlexoVM/flexovm

/**
 * Loads and links the dynamic library that is identified through the
 * specified path. This method is similar to {@link #loadLibrary(String)},
 * but it accepts a full path specification whereas {@code loadLibrary} just
 * accepts the name of the library to load.
 *
 * @param pathName
 *            the path of the file to be loaded.
 */
public static void load(String pathName) {
  Runtime.getRuntime().load(pathName, VMStack.getCallingClassLoader());
}

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

/**
 * Loads and links the dynamic library that is identified through the
 * specified path. This method is similar to {@link #loadLibrary(String)},
 * but it accepts a full path specification whereas {@code loadLibrary} just
 * accepts the name of the library to load.
 *
 * @param pathName
 *            the path of the file to be loaded.
 */
public static void load(String pathName) {
  Runtime.getRuntime().load(pathName, VMStack.getCallingClassLoader());
}

代码示例来源:origin: com.bugvm/bugvm-rt

/**
 * Loads and links the dynamic library that is identified through the
 * specified path. This method is similar to {@link #loadLibrary(String)},
 * but it accepts a full path specification whereas {@code loadLibrary} just
 * accepts the name of the library to load.
 *
 * @param pathName
 *            the path of the file to be loaded.
 */
public static void load(String pathName) {
  Runtime.getRuntime().load(pathName, VMStack.getCallingClassLoader());
}

代码示例来源:origin: com.gluonhq/robovm-rt

/**
 * Loads and links the dynamic library that is identified through the
 * specified path. This method is similar to {@link #loadLibrary(String)},
 * but it accepts a full path specification whereas {@code loadLibrary} just
 * accepts the name of the library to load.
 *
 * @param pathName
 *            the path of the file to be loaded.
 */
public static void load(String pathName) {
  Runtime.getRuntime().load(pathName, VMStack.getCallingClassLoader());
}

代码示例来源:origin: com.oracle.substratevm/svm

@Substitute
  public static void load(String filename) {
    // Substituted because the original is caller-sensitive, which we don't support
    Runtime.getRuntime().load(filename);
  }
}

代码示例来源:origin: ibinti/bugvm

/**
 * Loads and links the dynamic library that is identified through the
 * specified path. This method is similar to {@link #loadLibrary(String)},
 * but it accepts a full path specification whereas {@code loadLibrary} just
 * accepts the name of the library to load.
 *
 * @param pathName
 *            the path of the file to be loaded.
 */
public static void load(String pathName) {
  Runtime.getRuntime().load(pathName, VMStack.getCallingClassLoader());
}

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

/**
 * Loads and links the dynamic library that is identified through the
 * specified path. This method is similar to {@link #loadLibrary(String)},
 * but it accepts a full path specification whereas {@code loadLibrary} just
 * accepts the name of the library to load.
 *
 * @param pathName
 *            the absolute (platform dependent) path to the library to load.
 * @throws UnsatisfiedLinkError
 *             if the library can not be loaded.
 */
public void load(String pathName) {
  load(pathName, VMStack.getCallingClassLoader());
}

代码示例来源:origin: MobiVM/robovm

/**
 * Loads and links the dynamic library that is identified through the
 * specified path. This method is similar to {@link #loadLibrary(String)},
 * but it accepts a full path specification whereas {@code loadLibrary} just
 * accepts the name of the library to load.
 *
 * @param pathName
 *            the absolute (platform dependent) path to the library to load.
 * @throws UnsatisfiedLinkError
 *             if the library can not be loaded.
 */
public void load(String pathName) {
  load(pathName, VMStack.getCallingClassLoader());
}

代码示例来源:origin: com.gluonhq/robovm-rt

/**
 * Loads and links the dynamic library that is identified through the
 * specified path. This method is similar to {@link #loadLibrary(String)},
 * but it accepts a full path specification whereas {@code loadLibrary} just
 * accepts the name of the library to load.
 *
 * @param pathName
 *            the absolute (platform dependent) path to the library to load.
 * @throws UnsatisfiedLinkError
 *             if the library can not be loaded.
 */
public void load(String pathName) {
  load(pathName, VMStack.getCallingClassLoader());
}

代码示例来源:origin: ibinti/bugvm

/**
 * Loads and links the dynamic library that is identified through the
 * specified path. This method is similar to {@link #loadLibrary(String)},
 * but it accepts a full path specification whereas {@code loadLibrary} just
 * accepts the name of the library to load.
 *
 * @param pathName
 *            the absolute (platform dependent) path to the library to load.
 * @throws UnsatisfiedLinkError
 *             if the library can not be loaded.
 */
public void load(String pathName) {
  load(pathName, VMStack.getCallingClassLoader());
}

代码示例来源:origin: FlexoVM/flexovm

/**
 * Loads and links the dynamic library that is identified through the
 * specified path. This method is similar to {@link #loadLibrary(String)},
 * but it accepts a full path specification whereas {@code loadLibrary} just
 * accepts the name of the library to load.
 *
 * @param pathName
 *            the absolute (platform dependent) path to the library to load.
 * @throws UnsatisfiedLinkError
 *             if the library can not be loaded.
 */
public void load(String pathName) {
  load(pathName, VMStack.getCallingClassLoader());
}

代码示例来源:origin: com.bugvm/bugvm-rt

/**
 * Loads and links the dynamic library that is identified through the
 * specified path. This method is similar to {@link #loadLibrary(String)},
 * but it accepts a full path specification whereas {@code loadLibrary} just
 * accepts the name of the library to load.
 *
 * @param pathName
 *            the absolute (platform dependent) path to the library to load.
 * @throws UnsatisfiedLinkError
 *             if the library can not be loaded.
 */
public void load(String pathName) {
  load(pathName, VMStack.getCallingClassLoader());
}

代码示例来源:origin: diffplug/goomph

private void loadLibrary() {
  if (library != null) {
    try {
      if (library.indexOf("wpf") != -1) { //$NON-NLS-1$
        int idx = library.indexOf("eclipse_"); //$NON-NLS-1$
        if (idx != -1) {
          String comLibrary = library.substring(0, idx) + "com_"; //$NON-NLS-1$
          comLibrary += library.substring(idx + 8, library.length());
          Runtime.getRuntime().load(comLibrary);
          OleInitialize(0);
        }
      }
      Runtime.getRuntime().load(library);
    } catch (UnsatisfiedLinkError e) {
      //failed
    }
  }
  libraryLoaded = true;
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.equinox.launcher

private void loadLibrary() {
  if (library != null) {
    try {
      if (library.indexOf("wpf") != -1) { //$NON-NLS-1$
        int idx = library.indexOf("eclipse_"); //$NON-NLS-1$
        if (idx != -1) {
          String comLibrary = library.substring(0, idx) + "com_"; //$NON-NLS-1$
          comLibrary += library.substring(idx + 8, library.length());
          Runtime.getRuntime().load(comLibrary);
          OleInitialize(0);
        }
      }
      Runtime.getRuntime().load(library);
    } catch (UnsatisfiedLinkError e) {
      //failed
    }
  }
  libraryLoaded = true;
}

代码示例来源:origin: org.opendaylight.tcpmd5/tcpmd5-jni

private static void loadStream(final InputStream is) throws IOException {
  final Set<PosixFilePermission> perms = PosixFilePermissions.fromString("rwxr-x---");
  final Path p = Files.createTempFile(LIBNAME, null, PosixFilePermissions.asFileAttribute(perms));
  try {
    LOG.debug("Copying {} to {}", is, p);
    Files.copy(is, p, StandardCopyOption.REPLACE_EXISTING);
    try {
      Runtime.getRuntime().load(p.toString());
      LOG.info("Library {} loaded", p);
    } catch (UnsatisfiedLinkError e) {
      throw new IOException(String.format("Failed to load library %s", p), e);
    }
  } finally {
    try {
      Files.deleteIfExists(p);
    } catch (IOException e) {
      LOG.warn("Failed to remove temporary file {}", p, e);
    }
  }
}

相关文章