Join Slack
Communities
Powered by
Is there a way to pass a classloader to the script...
# scripting
s
steenooo
12/23/2019, 12:19 PM
Is there a way to pass a classloader to the script execution? I noticed there is such a field in the configuration, but I don't know how to access it
i
ilya.chernikov
01/07/2020, 11:33 AM
You need to pass it in the evaluation configuration, e.g. like it is done here -
https://github.com/JetBrains/kotlin/blob/master/libraries/tools/kotlin-main-kts-test/test/org/jetbrains/kotlin/mainKts/test/mainKtsTest.kt#L24
(here it is set to
null
to evaluate scripts in an isolated classloader, but you can use any classloader here.) By default, as you seems already discovered, thread context classloader is used as a base.
6
Views
Open in Slack
Previous
Next