eplerproject.org/luajava/">luajava documentation pages.
Typically, this library is included as part of a call to either {@link JsePlatform#standardGlobals()}
To instantiate and use it directly, link it into your globals table via {@link LuaValue#load(LuaValue)} using code such as:
{@code LuaTable _G = new LuaTable(); LuaThread.setGlobals(_G); LuaC.install(); _G.load(new BaseLib()); _G.load(new PackageLib()); _G.load(new LuajavaLib()); _G.get("loadstring").call( LuaValue.valueOf( "sys = luajava.bindClass('java.lang.System')\n"+ "print ( sys:currentTimeMillis() )\n" ) ).call(); }
This example is not intended to be realistic - only to show how the {@link LuajavaLib} may be initialized by hand. In practice, the {@code luajava} library is available on all JSE platforms via the call to {@link JsePlatform#standardGlobals()}and the luajava api's are simply invoked from lua.
This has been implemented to match as closely as possible the behavior in the corresponding library in C.
@see LibFunction
@see org.luaj.vm2.lib.jse.JsePlatform
@see org.luaj.vm2.lib.jme.JmePlatform
@see LuaC
@see http://www.keplerproject.org/luajava/manual.html#luareference