Interactive Console
We build a tiny console application with JLine3 every release. You may download the example-all.jar from our Release page. Or you can get the lastest snapshot from our workflow artifacts: choose the lastest build and find the example artifact.
The jar bundles desktop natives with it, so you should be able to play around with it on your own computer.
Lua Version can be any of 5.1, 5.2, 5.3, 5.4, luaj or jit.
Built-In Examples
We bundle several examples with the console JAR, which you may obtain using require.
require('luajava.ansiThreadedHelloWorld'): A simple Hello World with Java threads and Ansi printing.require('luajava.awtTest')(): Sets up an AWT frame to execute Lua commands.require('luajava.simpleLuaFile'): Executes a simple Lua file.require('luajava.swingTest')(): Sets up a Swing frame to execute Lua commands.require('luajava.testMemory'): Tests garbage collecting a bunch of Java objects and created threads.require('luajava.wrongLuaFile'): Tests loading a malformed Lua file.luajava = require('suite.luajava-compat'): Wraps thejavaAPI into the originalluajavaAPI.
Some of these examples return a function so that you may execute them as many times as you wish:
luajava.awtTestluajava.swingTestluajava.testMemory
Command Line Options
Usage: <main class> [-t] [-l=<lua>] [-f=<file> | -e=<expression>]
-e, --expr=<expression> The Lua expression to run
-f, --file=<file> The Lua file to run
-l, --lua=<lua> Specify the Lua version
-t, --test Run built-in tests1
2
3
4
5
2
3
4
5