Questions tagged [luaj]

Luaj is a pure Java implementation of a Lua interpreter (for versions 5.1 and now 5.2)

  • Java-centric implementation of lua vm built to leverage standard Java features.
  • Lightweight, high performance execution of lua.
  • Multi-platform to be able to run on JME, JSE, or JEE environments.
  • Complete set of libraries and tools for integration into real-world projects.
  • Dependable due to sufficient unit testing of vm and library features.

Luaj is written for JME and JSE, with string, table, package, math, io, os, debug, coroutine & luajava libraries, JSR-223 bindings, all metatags, weak tables and unique direct lua-to-java-bytecode compiling.

https://sourceforge.net/projects/luaj/

and

http://www.luaj.org/luaj/3.0/README.html#1

99 questions
0
votes
2 answers

LuaJ - Set package.path in Java code before calling a Lua script from a file

I figured out how to make Lua scripts require other Lua scripts in an Android environment. However, that solution has the package.path configuration inside the top level Lua script itself. I want to move the package.path configuration to the Java…
mnemy
  • 43
  • 7
0
votes
1 answer

LuaJ load from String instead of Path

today I tried the LuaJ library and I really enjoy it, the only problem i have with it, is that I can't load from a String containing the functions, instead I can only load of a string containing the filepath. Here is the code that I tried to load…
Zero
  • 1
  • 1
  • 2
0
votes
2 answers

Is it supported module function to define Lua module in Luaj?

In my lua script, it requires another lua module by following statement: require 'another' In my another lua module, the first line of code is: module(..., ) However, it looks like that Luaj does not has 'module' function defined or not support it…
0
votes
1 answer

LuaJ (or any other Java LUA interpreters) - Can you call a LUA script from Java without waiting for it to return?

I've been writing an RPG game engine for Android, and I've gotten to the point that I think I need to add a scripting language for my Battle Engine. Its just too complex to get by on XML configuration driving the game content, like I've been doing…
mnemy
  • 43
  • 7
0
votes
1 answer

LuaJ require json module in java

Im trying to load the json module in Java code. The example in the Doc shows that it should go like this but it doesnt work. Does it require the module to be in the project or it loads it from LUA_PATH. does anyone have any experience with this…
alknows
  • 1,972
  • 3
  • 22
  • 26
0
votes
2 answers

Force an integer type in luajava

Is there any way to force an integer type using LuaJava? I am attempting, in LuaJ 3.0 beta 1 (luaj-jse-3.0-beta1.jar), to create an instance of a java.awt.Color. You wouldn't think this would be such an issue, given the Java API availability of…
Nathan
  • 585
  • 6
  • 12
0
votes
1 answer

LuaJ add lua function in Java

I am aware of this method: How can I add functions to _G that run java code using Luaj? But that link lets you add functions such as math.abs(...). I just want to add functions without libraries or having to use require, you can just use…
Entity
  • 7,972
  • 21
  • 79
  • 122
0
votes
1 answer

Requiring Java Classes in LuaJ

I'm attempting to make a game library in Java that uses Lua for the scripts. The real issue appears when I try to require a Java class (that is inside of a jar), and whenever I try to do so, I get an error much like the one below: Exception in…
0
votes
1 answer

How can I call the original method with CGLib?

I'm using CGLib to dynamicly change a TileEntity (Minecraft). In the InvocationHandler I call the Lua functions for the interface, but I want the methods that already exist to be called in Java. This is my invoke method: public Object…
Rule
  • 105
  • 1
  • 10
1 2 3 4 5 6
7