Set java.class.path property in runner and loader
#KT-24991 fixed
This commit is contained in:
@@ -58,6 +58,7 @@ abstract class AbstractRunner : Runner {
|
||||
}
|
||||
|
||||
Thread.currentThread().contextClassLoader = classLoader
|
||||
val savedClasspathProperty = System.setProperty("java.class.path", classpath.joinToString(File.pathSeparator))
|
||||
|
||||
try {
|
||||
main.invoke(null, arguments.toTypedArray())
|
||||
@@ -68,6 +69,10 @@ abstract class AbstractRunner : Runner {
|
||||
catch (e: InvocationTargetException) {
|
||||
throw e.targetException
|
||||
}
|
||||
finally {
|
||||
if (savedClasspathProperty == null) System.clearProperty("java.class.path")
|
||||
else System.setProperty("java.class.path", savedClasspathProperty)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user