Skip to content

Instantly share code, notes, and snippets.

View gist:9b498390741ce5efe36ab9564cef55b6
import org.graalvm.polyglot.*;
import java.util.List;
class M {
public static void main(String[] args) {
try (Context context = Context.newBuilder().allowAllAccess(true).build()) {
java.util.ArrayList v = context.eval("js",
"var ArrayList = Java.type('java.util.ArrayList');" +
"var list = new ArrayList();" +
"list.add(1); list").asHostObject();