3 Star 1 Fork 0

Gitee 极速下载 / luaj

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/luaj/luaj
克隆/下载
SampleJseMain.java 854 Bytes
一键复制 编辑 原始数据 按行查看 历史
import org.luaj.vm2.Globals;
import org.luaj.vm2.LuaValue;
import org.luaj.vm2.lib.jse.JsePlatform;
/** Simple program showing the minimal Java program to launch a script.
*
* <p> In typical usage, a Globals object must be created to hold global state,
* and it can be used to compile and load lua files into executable LuaValue
* instances.
*
* @see Globals
* @see LuaValue
*/
public class SampleJseMain {
public static void main(String[] args) throws Exception {
String script = "examples/lua/hello.lua";
// create an environment to run in
Globals globals = JsePlatform.standardGlobals();
// Use the convenience function on Globals to load a chunk.
LuaValue chunk = globals.loadfile(script);
// Use any of the "call()" or "invoke()" functions directly on the chunk.
chunk.call( LuaValue.valueOf(script) );
}
}
1
https://gitee.com/mirrors/luaj.git
git@gitee.com:mirrors/luaj.git
mirrors
luaj
luaj
master

搜索帮助