Basic code executor for KayJam Core
-
Add the library depending on:
Maven:
<dependency> <groupId>com.github.kayjamlang</groupId> <artifactId>executor</artifactId> <version>0.1.3.21</version> </dependency>
Gradle:
(Groovy)
implementation group: 'com.github.kayjamlang', name: 'executor', version: '0.1.3.21'
(Kts)
implementation("com.github.kayjamlang:executor:version: '0.1.3.21")
-
Call the method of the Executor class, which will return the result of the code execution in Object:
class Main { public static void main(String[] args){ String code = "println(\"Hello, World\");"; Executor executor = new Executor(); //Default library executor.addLibrary(new MainLibrary()); executor.execute(code); } }