【发布时间】:2014-02-17 15:03:29
【问题描述】:
我试图在 Java 代码中加载 json 模块。文档中的示例显示它应该像这样,但它不起作用。它要求模块在项目中还是从 LUA_PATH 加载它。有人有这个问题的经验吗?
Globals globals = JsePlatform.standardGlobals();
globals.get("require").call( LuaValue.valueOf("json") );
线程 "main" org.luaj.vm2.LuaError 中的异常:模块 'json' 不是 发现:json 没有字段 package.preload['json'] json.lua 没有类 'json'
看起来它只是在 LuaJ 包中尝试。
【问题讨论】: