private static @Nullable String getAvailableJavaHome(@NotNull Project project) {
    Pair<String, Sdk> sdkPair = ExternalSystemJdkUtil.getAvailableJdk(project);
    if (ExternalSystemJdkUtil.isValidJdk(sdkPair.second)) {
      return sdkPair.second.getHomePath();
    }
    return null;
  }
private static @Nullable String getAvailableJavaHome(@NotNull Project project)