I think luaState.pushJavaObject(Object)
and luaState.pushJaveObjectRaw(Object)
are methods You're looking for :) Sadly, can't see this documented and it's not that clear from sources, at least to me.
EDIT:
Yup, it is. Look at this code piece from ./main/c/jnlua.c
(jnlua sources):
/* ---- Java objects and functions ---- */
/* Pushes a Java object on the stack. */
static void pushjavaobject (lua_State *L, jobject object) {
jobject *user_data;
user_data = (jobject *) lua_newuserdata(L, sizeof(jobject));
luaL_getmetatable(L, JNLUA_OBJECT);
*user_data = (*thread_env)->NewGlobalRef(thread_env, object);
if (!*user_data) {
lua_pushliteral(L, "JNI error: NewGlobalRef() failed pushing Java object");
lua_error(L);
}
lua_setmetatable(L, -2);
}