我正在学习Lua和Java的LuaJ库。我看到了如何创建和运行脚本:
String script = "message = 'Hello World!'";
InputStream input = new ByteArrayInputStream(script.getBytes());
Prototype prototype = LuaC.compile(input, "script");
LuaValue globals = JsePlatform.standardGlobals();
LuaClosure closure = new LuaClosure(prototype, globals);
LuaValue value = closure.call();
如何将Lua变量message
的值返回给Java并通过LuaValue
访问它?这可能吗?