2026-03-03 12:00:16 +01:00
2026-03-03 10:55:46 +01:00
2026-03-03 11:59:03 +01:00
2026-03-02 14:22:54 +01:00
2026-03-01 21:42:19 +01:00
2026-03-03 11:59:03 +01:00
2026-03-03 11:59:03 +01:00
2026-03-03 10:55:46 +01:00
2020-04-01 19:31:39 +03:00
2026-03-03 10:55:46 +01:00
2026-03-03 10:55:46 +01:00
2010-04-25 15:50:40 +00:00
2026-03-03 11:54:14 +01:00
2026-03-03 12:00:16 +01:00
2026-03-03 10:55:46 +01:00
2026-03-03 10:55:46 +01:00
2026-03-03 10:55:46 +01:00

License notice

All third party licenses can be found in the module resources/license folder Project license is in LICENSE-File

LuaJ

LuaJ is a Java implementation of Lua with JSE and JME targets.

This fork is maintained by Open Autonomous Connection and is built with Maven only. The current codebase targets Lua 5.5 semantics in the supported runtime paths, including global, named vararg tables, read-only for variables, table.create, updated utf8.offset, binary chunk compatibility, and the existing Lua 5.4 <close> and <const> behavior.

Modules

  • core: VM, compiler, standard runtime pieces
  • jse: Java SE platform, JSR-223 integration, LuaJC support
  • jme: Java ME platform support

Requirements

  • Java 25
  • Maven 3.9+

The repository includes a Maven Wrapper:

  • Windows: mvnw.cmd
  • Unix-like shells: ./mvnw

Build

Build all modules:

.\mvnw.cmd clean package

Run the full test suite:

.\mvnw.cmd clean test

Build a single module with dependencies:

.\mvnw.cmd -pl jse -am package

Quick Start

Minimal JSE embedding example:

import org.luaj.vm2.Globals;
import org.luaj.vm2.LuaValue;
import org.luaj.vm2.libs.jse.JsePlatform;

Globals globals = JsePlatform.standardGlobals();
LuaValue chunk = globals.load("print('hello, world')");
chunk.call();

Maven Usage

Use the published modules directly from Maven:

<dependency>
  <groupId>org.openautonomousconnection.luaj</groupId>
  <artifactId>jse</artifactId>
  <version>3.0.2</version>
</dependency>

For the core VM without the JSE platform layer:

<dependency>
  <groupId>org.openautonomousconnection.luaj</groupId>
  <artifactId>core</artifactId>
  <version>3.0.2</version>
</dependency>

Notable Runtime Notes

  • LuaJ runs on the host JVM garbage collector. Resource cleanup is not equivalent to native Lua finalization.
  • Explicit close is still the correct pattern for files, iterators, and host-backed resources.
  • LuaJC is available on JSE and covered by the current Maven test path. For 5.5-only constructs that the legacy bytecode generator does not model directly, it falls back to generated delegate wrappers over LuaClosure.
  • JME support remains in the Maven build, with environment-specific limitations depending on available Java ME APIs.
  • The repository currently passes .\mvnw.cmd -q clean test.

Examples

Relevant examples are in:

  • examples/jse
  • examples/jme
  • examples/lua
  • examples/maven

License

This project is distributed under the terms in LICENSE.

Description
Lightweight, fast, Java-centric Lua interpreter 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. Forked GitHub Repository: https://github.com/luaj/luaj
https://luaj.sourceforge.net/ Readme MIT 18 MiB
Languages
Java 99.6%
PowerShell 0.4%