I want to learn how to develop, combining more than one programming language, using java with moon scripts.
I want to learn how to develop, combining more than one programming language, using java with moon scripts.
LuaJ offers a very simple integration interface between Java and the Moon.
import org.luaj.vm2.*;
import org.luaj.vm2.lib.jse.*;
Globals globals = JsePlatform.standardGlobals();
LuaValue chunk = globals.loadfile("examples/lua/hello.lua"); // seu script lua
chunk.call();
You can save the returned value from chunk.call()
to a variable. This is the result of the executed script. Font
LuaJ is fully open source and is in GitHub .