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
1
vote
1 answer

LuaJ (Java) Compile to jar

So I got this java file which loads a .lua file. Pretty basic and it works if I try to run it in Eclipse. Now when I compile the project in a runnable jar file it wont load at all. When you double click it, it just loads and stops. I tried multiple…
Dallox
  • 487
  • 5
  • 8
  • 19
0
votes
1 answer

Luaj - add JButton action listener from Lua

In the application I'm developing in Java SE I use Luaj to implement functionality (this is a data collector application). The Java app reads a COM port of a device and gives the data to Lua event handlers which are written by the user of the…
olaszakos
  • 1
  • 1
0
votes
0 answers

Miui defines the application as a trojan

I created the app(not a virus!) in android studio. It uses the luaj library. Overlay and accessibility service are also used. However, when I install this application on miui, the built-in antivirus detects the application as a Trojan. I think the…
karlson
  • 11
  • 1
0
votes
0 answers

Starting up with Luaj

Are there any good Luaj tutorials? I have been working on a game using Lua for for mi finals but my profesor wants me to implement my code to java. I already read the Luaj manual but i found it quite confusing and i need to implement mi lua code…
Joax48
  • 1
0
votes
1 answer

Why is Intellij Idea freezing during indexing?

I'm on Manjaro linux using Intellij Idea community 4:2022.1.3-1 and jdk 17 for this project, maven is also present Intellij always hangs after it starts indexing the jdk, it's responsive for a period of time but if I type anything or open a new menu…
Bam
  • 23
  • 1
  • 7
0
votes
1 answer

Pass Java HashMap to Lua script

I want to pass a Java HashMap to a Lua script from Java code in LuaJ. But all I see is we have chunk.call() and chunk.invoke() where we can pass the arguments or array of LuaValue.valueOf(), which allow us either int, byte, double, string and…
anonymous
  • 3
  • 2
0
votes
1 answer

luaj can't import my app's classes: vm error: java.lang.ClassNotFoundException

when trying to import any class from my application, luaj(3.0-beta2) throws an exception that the class cannot be found, when importing built-in classes, there is no such problem code run function public static boolean run(String code){ try…
bolyuk
  • 1
  • 2
0
votes
1 answer

JavaFX and luaj in eclipse - java.lang.module.InvalidModuleDescriptorException: luajc.class found in top level directory

I have to convert my project from SWT to JavaFX. This project made a great use of luaj for coercion and executions of lua scripts and worked well in swt. But there a difference with javafx. Javafx works as a module. Since then, I have troubles with…
Nmare418
  • 21
  • 4
0
votes
0 answers

how do i fix "Error occurred during initialization of boot layer" that i get from luaJ

I tried to get luaJ to work but when i add luaj .jar files to modularpath i get this error: Error occurred during initialization of boot layer java.lang.module.FindException: Unable to derive module descriptor for D:\Program…
0
votes
1 answer

How do I get locals from a lua script in java

I have this lua script: local set = {} set.name = "DebugMenu" set.setName = "DebugMenu" set.descriptionFilenameOverride = "" set.logicalName = "" In java I have: LuaValue script = globals.load(..input stream.., "main", "t",…
0
votes
1 answer

LuaJ Iterate over Object Array in Coerced Java Object

I'm working with LuaJ 3.0.1 and am having issues iterating over an array contained in a coerced Java object in my Lua script. Currently, here's what I'm doing: I have a Java class that contains an array of objects. Something like public class Foo…
0
votes
1 answer

Open Arrays or ArrayLists in Lua (Convert array to table)

A method in java returns an Array, and I want to manipulate the information from that array in Lua but it seems that Lua doesn't convert arrays to tables as I'd hoped. Is there a way to do this? For example I have this method in Java: public Node[]…
Timotheus
  • 2,250
  • 5
  • 29
  • 39
0
votes
0 answers

It is possible to luaj convert a script to the binary representation of lua 5.2

I am trying to convert a script to binary representation using string.dump, but I saw that the luaj 3.0.1 representation is different from lua 5.2, has some way of changing this, or turns the luaj 3.0.1 representation into lua 5.2 ? Code Globals _G…
Idle
  • 1
  • 1
0
votes
1 answer

Excute lua script in java

Iam trying to excute an lua script in android studio for this i used Luaj library from http://www.luaj.org/luaj/3.0/README.html? . String script = "assets/hello.lua"; Globals globals = JsePlatform.standardGlobals(); LuaValue chunk =…
0
votes
1 answer

How to get "android.provider.ContactsContract.Contacts" field in Luaj

I use Lua Interpreter to get information for my iGO navigator and I need to get some fields from android.provider.ContactsContract.Contacts I got successfully cntr = luajava.bindClass("android.provider.ContactsContract") and I try to get Contacts…
WANDEL
  • 1
  • 3