diff --git a/src/main/kotlin/de/swirtz/ktsobjectloader/KtsObjectLoader.kt b/src/main/kotlin/de/swirtz/ktsobjectloader/KtsObjectLoader.kt index b9486a7..147a847 100755 --- a/src/main/kotlin/de/swirtz/ktsobjectloader/KtsObjectLoader.kt +++ b/src/main/kotlin/de/swirtz/ktsobjectloader/KtsObjectLoader.kt @@ -1,13 +1,13 @@ package de.swirtz.ktsobjectloader import org.jetbrains.kotlin.script.jsr223.KotlinJsr223JvmLocalScriptEngine -import org.jetbrains.kotlin.script.jsr223.KotlinJsr223JvmLocalScriptEngineFactory import java.io.Reader +import javax.script.ScriptEngineManager class KtsObjectLoader { - val engine = - KotlinJsr223JvmLocalScriptEngineFactory().scriptEngine as KotlinJsr223JvmLocalScriptEngine + val engine = ScriptEngineManager().getEngineByExtension("kts") + as KotlinJsr223JvmLocalScriptEngine inline fun load(script: String): T { val loaded: Any = engine.eval(script)