How can I embed Lua in Java?

前端 未结 4 678
无人及你
无人及你 2020-11-29 01:34

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

相关标签:
4条回答
  • 2020-11-29 01:51

    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/

    0 讨论(0)
  • 2020-11-29 02:00

    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.

    0 讨论(0)
  • 2020-11-29 02:01

    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.

    0 讨论(0)
  • 2020-11-29 02:07

    Try also kahlua and Mochalua.

    0 讨论(0)
提交回复
热议问题