void (@NotNull SdkType type, @NotNull ProgressIndicator indicator, @NotNull DetectedSdkListener callback) { try { Collection<String> suggestedPaths = type.suggestHomePaths(); for (String path : suggestedPaths) { indicator.checkCanceled(); if (path == null) continue; try { //a sanity check first if (!Files.exists(Paths.get(path))) continue; if (!type.isValidSdkHome(path)) continue; } catch (Exception e) { LOG.warn("Failed to process detected SDK for " + type + " at " + path + ". " + e.getMessage(), e); continue; } String version; try { version = type.getVersionString(path); } catch (Exception e) { LOG.warn("Failed to get the detected SDK version for " + type + " at " + path + ". " + e.getMessage(), e); continue; } if (version == null) { LOG.warn("No version is returned for detected SDK " + type + " at " + path); continue; } callback.onSdkDetected(type, version, path); } } catch (ProcessCanceledException e) { throw e; } catch (Exception e) { LOG.warn("Failed to detect SDK: " + e.getMessage(), e); } }