How can I embed Lua in Java?

JavaLua

Java Problem Overview


Is LuaJava a must for this? Or can I embed Lua into Java without it?

Java Solutions


Solution 1 - Java

LuaJ is easy to embed in Java. I did have to change a few lines of their source to get it to work how I expected (it didn't require the IO library automatically).

http://sourceforge.net/projects/luaj/

Solution 2 - Java

Try also kahlua and Mochalua.

Solution 3 - Java

There is http://www.keplerproject.org/luajava/manual.html, but essentially lua is more suitable for integration with C. There are a bunch of other scripting languages with good java integration around though. Consider groovy, jruby or jython for starters.

Solution 4 - Java

Lua is a C library, you can embed it in Java but you'll have to interface the java virtual machine and Lua with some C code.

The LuaJava authors have already done that work - you're better off using that than writing your own.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionanonView Question on Stackoverflow
Solution 1 - JavaBen ZieglerView Answer on Stackoverflow
Solution 2 - JavalhfView Answer on Stackoverflow
Solution 3 - JavaManfred MoserView Answer on Stackoverflow
Solution 4 - JavanosView Answer on Stackoverflow