public String getJavaDir() {
    String separator = System.getProperty("file.separator");
    String path = System.getProperty("java.home") + separator + "bin" + separator;

    if ((getCurrentPlatform() == WINDOWS) && 
      (new File(path + "javaw.exe").isFile())) {
      return path + "javaw.exe";
    }

    return path + "java";
  }