code: private static File getJdkHomeDir(@Nullable String baseDirectoryPath,
        @Nullable String homeDirPath, String vmConfigName)
            throws InvalidConfigurationException {
      if (homeDirPath == null) {
        File baseDirectory = getBaseDirectory(baseDirectoryPath);
        File homeDir = new File(baseDirectory, vmConfigName);
        checkConfiguration(homeDir.isDirectory(), "%s is not a directory", homeDir);
        return homeDir;
      } else {
        File potentialHomeDir = new File(homeDirPath);
        if (potentialHomeDir.isAbsolute()) {
          checkConfiguration(potentialHomeDir.isDirectory(), "%s is not a directory",
              potentialHomeDir);
          return potentialHomeDir;
        } else {
          File baseDirectory = getBaseDirectory(baseDirectoryPath);
          File homeDir = new File(baseDirectory, homeDirPath);
          checkConfiguration(homeDir.isDirectory(), "%s is not a directory", potentialHomeDir);
          return homeDir;
        }
      }
    }
docs: TODO(gak): make this work with different directory layouts.  I'm looking at you OS X...