JSR 223
According to Scripting for the Java Platform - Wikipedia:
Scripting for the Java Platform was developed under the Java Community Process as JSR 223. The final release of JSR 223 happened on December 11, 2006. The specification, however, was withdrawn later on December 13, 2016 after a Maintenance Review Ballot, where it was decided that this functionality would be included as an integral part of Java 9 and onward.
To use LuaJava with JSR 223, you need to include one more artifact:
implementation "party.iroiro.luajava:jsr223:${luaJavaVersion}"
<dependency>
<groupId>party.iroiro.luajava</groupId>
<artifactId>jsr223</artifactId>
<version>${luaJavaVersion}</version>
</dependency>
2
3
4
5
Caveats
Lua Versions
By default, the JSR 223 provider finds an available Lua implementation and use that to evaluate scripts. If there are multiple implementations, the one with a higher version number is selected:
party.iroiro.luajava.lua54.Lua54
party.iroiro.luajava.lua53.Lua53
party.iroiro.luajava.lua52.Lua52
party.iroiro.luajava.luaj.LuaJ
party.iroiro.luajava.luajit.LuaJit
party.iroiro.luajava.lua51.Lua51
2
3
4
5
6
If you want one of them instead, specify the system property luajava.jsr-223
: 54
53
52
jit
luaj
or 51
:
System.setProperty("luajava.jsr-223", "jit");