nirhal / JLua

JLua is a scripting tool for Java. JLua is a fork of LuaJava. It includes many bug fixes and new features.
MIT License
17 stars 1 forks source link

Jlua

JLua is a scripting tool for Java. This tool allows scripts written in Lua to manipulate components developed in Java and vice versa.

JLua is a fork of "LuaJava". It offers the following improvements:

Building JLua

First, change your current working directory to the build directory. Then, run cmake:

cmake /path/to/source/

For 64-bit build run:

cmake /path/to/source/ -DCMAKE_GENERATOR_PLATFORM=x64

On Linux/Mac the default generator is Unix Makefiles, so the build can be started by invoking the make executable:

make

On Windows the default generator is a Visual Studio project file. You can open the file and build manually or execute the following command from the VS Native Tools command prompt:

devenv Project.sln /build Debug

Before running the Java program, make sure you have the .so (UNIX) or .dll (Windows) file path in your "LD_LIBRARY_PATH" (UNIX) or "PATH" (Windows) environment variable.

Usage from Lua

This library offers 5 functions:

Usage from Java

The "Lua" object offer many methods to manipulate lua objects. See src/java/org/jlua/Console.java for simple usage example.