add sa-jdi.jar to classpath if available - for IDEA-168185

This commit is contained in:
Egor Ushakov
2018-08-17 16:06:46 +03:00
parent 8ea502c859
commit 93accee11f
@@ -40,6 +40,7 @@ public class BootstrapClassLoaderUtil extends ClassUtilCore {
addIDEALibraries(classpath);
addAdditionalClassPath(classpath);
addParentClasspath(classpath, true);
addSAJDIJar(classpath);
UrlClassLoader.Builder builder = UrlClassLoader.build()
.urls(filterClassPath(new ArrayList<>(classpath)))
@@ -134,6 +135,16 @@ public class BootstrapClassLoaderUtil extends ClassUtilCore {
parseClassPathString(System.getProperty(PROPERTY_ADDITIONAL_CLASSPATH), classpath);
}
/**
* search and add sa-jdi.jar if available, currently works only for IDEA updated from sources
*/
private static void addSAJDIJar(Collection<URL> classpath) throws MalformedURLException {
File saJdiJar = new File(System.getProperty("java.home"), "../lib/sa-jdi.jar");
if (saJdiJar.exists()) {
classpath.add(saJdiJar.toURI().normalize().toURL());
}
}
private static void parseClassPathString(String pathString, Collection<URL> classpath) {
if (pathString != null && !pathString.isEmpty()) {
try {