Advertisement

Best way to use LUA in Java?

Started by October 18, 2011 01:40 AM
0 comments, last by JonBonazza 13 years, 1 month ago
Hi!

I think it would be really nice to use Lua in my Java game for some stuff like the interface and some stuff I want to extend on the fly without recompiling (items for example). Maybe I'll use it for scripts in maps as well.

I found 3 ways to use Lua in Java. LuaJ, LuaJava and Kahlua2. Kahlua2 was the only project I could build on my system but the tests, which Kahlua2 does after compiling, failed. LuaJ couldn't find something called "Sun wireless <can't remember the rest>" and LuaJava couldn't find the jni.h and I wasn't able to create a new one.

I'm really pissed at the moment because I've got to use Java. Normally, I wouldn't use it because I'm a huge fan of Objective-C but I've got some people who help me and they don't own a Mac and GNUstep is a little bit scary because you don't hear anything new about it and they have some conditions you need to follow (you can't use every library and stuff like that. But I don't know how much I need there libraries). Additionally, I had some very weird errors while compiling some projects but this is another topic. But the point is: Objective-C = C and it was pretty easy to use Lua and extend is like I want (I built a small networking library) and it just works without any "Q.Q you need to use third party stuff because you can't just call native stuff out of Java even if you know what the hell you are doing!".

I also think about the idea to write my own wrapper for Lua. Maybe this would solve all my problems but I think this will consume a lot of time and it would be easier to use another scripting language.

But I don't want to use another language. I like Lua and actually, Lua is the only scripting language I really know and I really like. I could vomit every time I've got to deal with PHP and JS. I never used Ruby and Python. Maybe I could switch the language but this should be the last option. I want Lua!

thanks for reading
P.
I use LuaJava (and the android port, AndroLua) with no problems. It is, however, the only one I have tried, so I can't critique any of the others.

What issues are you having with LuaJava?
Co-founder/Lead Programmer
Bonafide Software, L.L.C.
Fairmont, WV 26554 US

This topic is closed to new replies.

Advertisement