From 694d51d7bb5a5900fb30d201a8d675cec0f5e92b Mon Sep 17 00:00:00 2001 From: Simon Ogorodnik Date: Sat, 4 Nov 2017 02:09:16 +0300 Subject: Fix Can't find node by signature in asJava mode fixes #205 --- runners/cli/src/main/kotlin/cli/main.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'runners/cli/src') diff --git a/runners/cli/src/main/kotlin/cli/main.kt b/runners/cli/src/main/kotlin/cli/main.kt index c12166c5..77ca57f6 100644 --- a/runners/cli/src/main/kotlin/cli/main.kt +++ b/runners/cli/src/main/kotlin/cli/main.kt @@ -139,8 +139,10 @@ object MainKt { fun createClassLoaderWithTools(): ClassLoader { val toolsJar = findToolsJar().canonicalFile.toURI().toURL() + val originalUrls = (javaClass.classLoader as? URLClassLoader)?.urLs val dokkaJar = javaClass.protectionDomain.codeSource.location - return URLClassLoader(arrayOf(toolsJar, dokkaJar), ClassLoader.getSystemClassLoader().parent) + val urls = if (originalUrls != null) arrayOf(toolsJar, *originalUrls) else arrayOf(toolsJar, dokkaJar) + return URLClassLoader(urls, ClassLoader.getSystemClassLoader().parent) } fun startWithToolsJar(args: Array) { -- cgit