String () { if (PluginManagerCore.isRunningFromSources()) { Class<?> aClass = CommandLineWrapper.class; try { String resourcePath = aClass.getName().replace('.', '/') + ".class"; Enumeration<URL> urls = aClass.getClassLoader().getResources(resourcePath); while (urls.hasMoreElements()) { URL url = urls.nextElement(); // prefer dir if (url.getProtocol().equals(URLUtil.FILE_PROTOCOL)) { String path = URLUtil.urlToFile(url).getPath(); String testPath = path.replace('\\', '/'); String testResourcePath = resourcePath.replace('\\', '/'); if (StringUtilRt.endsWithIgnoreCase(testPath, testResourcePath)) { return path.substring(0, path.length() - resourcePath.length() - 1); } } } } catch (IOException e) { LOG.error(e); } } return JavaSdkUtil.getIdeaRtJarPath(); }