String (@NotNull String exePath, @Nullable String defaultPath) { if (SystemInfo.isWindows) { if (!StringUtil.containsChar(exePath, '/') && !StringUtil.containsChar(exePath, '\\')) { List<String> executableFileExtensions = getWindowsExecutableFileExtensions(); String[] baseNames = ContainerUtil.map2Array(executableFileExtensions, String.class, s -> exePath + s); List<File> exeFiles = findExeFilesInPath(true, null, getPathVariableValue(), baseNames); File foundFile = ContainerUtil.getFirstItem(exeFiles); if (foundFile != null) { return foundFile.getAbsolutePath(); } } } return defaultPath; }