Пример #1
0
  // Validation approach:
  //  - JRE marker (rt.jar)
  //  - FX marker (jfxrt.jar)
  //  - JDK marker (tools.jar)
  private static boolean checkJDKRoot(File jdkRoot) {
    File rtJar = new File(jdkRoot, "jre/lib/rt.jar");
    if (!rtJar.exists()) {
      Log.verbose("rt.jar is not found at " + rtJar.getAbsolutePath());
      return false;
    }

    File jfxJar = new File(jdkRoot, "jre/lib/ext/jfxrt.jar");
    if (!jfxJar.exists()) {
      // Try again with new location
      jfxJar = new File(jdkRoot, "jre/lib/jfxrt.jar");
      if (!jfxJar.exists()) {
        Log.verbose("jfxrt.jar is not found at " + jfxJar.getAbsolutePath());
        return false;
      }
    }

    File toolsJar = new File(jdkRoot, "lib/tools.jar");
    if (!toolsJar.exists()) {
      Log.verbose("tools.jar is not found at " + toolsJar.getAbsolutePath());
      return false;
    }

    return true;
  }
Пример #2
0
  // select subset of given runtime using predefined rules
  public void setRuntime(File baseDir) {
    baseDir = validateRuntimeLocation(baseDir);

    // mistake or explicit intent to use system runtime
    if (baseDir == null) {
      Log.verbose("No Java runtime to embed. Package will need system Java.");
      runtime = null;
      return;
    }
    doSetRuntime(baseDir);
    useDefaultRuntime = false;
  }