How to only execute Kotlin scripts, similar to executing JavaScript.

I want to execute the Kotlin script input by the user in the plugin. Is there a method similar to JavaScript

 

   ScriptEngineManager factory = new ScriptEngineManager();
        // create a JavaScript engine
   ScriptEngine engine = factory.getEngineByName("JavaScript");
        // evaluate JavaScript code from String
   engine.eval("print('Hello, World')");
0

Please sign in to leave a comment.