Questions tagged [luajava]

A scripting tool for Java that allows easy interfacing of Lua and Java code by allowing Lua code to access and manipulate Java objects and allowing Java code to implement interfaces using Lua.

LuaJava is a scripting tool for Java that allows scripts written in Lua to manipulate components developed in Java and also access components from Lua using the same syntax that is used for accessing Lua`s native objects. It also allows Java to implement an interface using Lua.

The official website is http://www.keplerproject.org/luajava/.

55 questions
5
votes
2 answers

How Do I Load Lua Module as a String Instead of a File?

I am using LuaJava and C Code for Lua. What I am trying to do is read Lua source stored as a resource String in an Android application so that the Lua source read in can be executed. I need to know how to do this using LuaJava or C language. I want…
Androider
  • 21,125
  • 36
  • 99
  • 158
5
votes
4 answers

Linker errors using LuaJava on OSX 10.5

I'm having a bunch of problems getting this library to work on my OSX installation. In particular, I'd like to use it with a Java 1.6 VM but after I compile it up I get the following: java -cp "luajava-1.1.jar"…
Daniel
  • 23,365
  • 10
  • 36
  • 34
4
votes
2 answers

LuaJava Setting Error Handler for LuaState.pcall(a,b, error_function_index)?

I am trying to call: LuaState.pcall(num_args,num_returns, error_handler_index). I need to know how to set the error handler for this function. In fact, I think it would be nice it someone showed how to invoke a Lua function and get a numerical…
Androider
  • 21,125
  • 36
  • 99
  • 158
3
votes
1 answer

No console output when running LuaJava Hello, World program

I'm starting out to learn Lua script usage in Java via LuaJava; my IDE is Eclipse. But when I execute this simple Hello World snippet there is no output in the Eclipse console. Took the code snippet from here package com.cpg.lua; import…
Mandark
  • 798
  • 1
  • 12
  • 33
3
votes
1 answer

How to call Java Function in a lua coroutine?

I'm developing a game by luajava.When I call a java function in a lua coroutine,I get an error "Invalid method call. No such method." Here is the code package com.soyomaker; import org.keplerproject.luajava.LuaException; import…
wp_g4
  • 31
  • 3
3
votes
3 answers

Call a Java-method with a variable number arguments from a Luafile with LuaJava

in our project I try to call a java method from lua which has a variable number of arguments. So the code of the java-method looks like: public static void addEvent( String luaFile, String function, int milliseconds,…
FredFS
  • 33
  • 3
3
votes
1 answer

LuaJava for Android?

Is it possible to use LuaJava in an android application? The LuaJava project directory contains makefiles for Windows and Linux. It wouldn't be too difficult to create one for Android and compile using NDK, but I just want to know whether it is…
SatheeshJM
  • 3,575
  • 8
  • 37
  • 60
2
votes
2 answers

Lua Newbie stuck on simple input

I'm trying to pick up Lua programming but I'm stuck on something that's probably trivial. I'm prototyping some Lua scripts using Kahlua from IntelliJ Idea 11 and I keep getting errors whenever I try to use io.read(). Here's what I currently…
Cliff
  • 10,586
  • 7
  • 61
  • 102
2
votes
2 answers

LuaJava Error in Error Handling

I am trying to call a simple Lua function from Java using LuaJava. calc.lua: function foo(n) return n*2 end Thats all there is in calc.lua and subsequent calls from command line work. Here is the call that always has error : L.getGlobal("foo"); …
Androider
  • 21,125
  • 36
  • 99
  • 158
2
votes
2 answers

How To Catch Exception In Lua? I Am Using LuaJava

I am using luajava. When lua execute wrong,I cannot catch exception,and then jdk crashed. So how can I catch exception in lua?I just catch error like this(java code): LuaState ls = LuaStateFactory.newLuaState(); ls.openLibs(); String luaPath =…
gaochao
  • 21
  • 2
2
votes
1 answer

Get Android System Setting via luajava

I am trying to get the value of a system setting in a XPrivacyLua custom hook. Settings.Secure | Android Developers #getInt() function after(hook, param) local result = param:getResult() if result == null or result:getItemCount() == 0…
Steven
  • 13,501
  • 27
  • 102
  • 146
2
votes
1 answer

LuaJava indexing Java arrays in Lua

In my application, I need my lua script to index a java array. For some reason I don't understand, I can't index the array at all within Lua. Here is my Lua file (test_lua.lua): https://pastebin.com/zQUPVArz Here is the Java file calling this code…
Derek S
  • 119
  • 7
2
votes
1 answer

Embedding LuaJIT in Java

If I wanted to embed a normal Lua script in Java, I'd use LuaJ. However, I need to find a way to embed scripts which use LuaJIT's FFI library. One option would be to use LuaJava, but it doesn't appear to be maintained anymore. Any alternatives? I…
Alexey Romanov
  • 167,066
  • 35
  • 309
  • 487
2
votes
1 answer

EnumMap with LuaJava (attempt to call a nil value)

As the title says, I have problem with LuaJava and EnumMap. I'm trying to do a RPG Library, so we have a Character with some Attributes and a list of them. In the code below, I'll report only important things. I have a class called ConcreteAttribute…
holls
  • 23
  • 4
1
vote
1 answer

Building LuaJava on OSX Snow Leopard

I am trying to build LuaJava on OSX Snow Leopard and I am getting a linking problem. I have modified the config script for OSX and I have ensured that all of the paths there are correct. I had to change luajava.c(line 2795) to have lua_resume take…
CaseyB
  • 24,780
  • 14
  • 77
  • 112
1
2 3 4