🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

using java as scripting language

Started by
0 comments, last by thedigga007 20 years, 6 months ago
I am trying to using java as a scripting language in my game engine by envoking the jvm from my native code and having interface back and forth to my engine. I am able to invoke the JVM and call java functions, but I am unable to call a java method that calls a native method from within it. Has anyone ever attempted this before? Is there any articles/resources out there? Any help would be appreciated.
Advertisement
Don''t have any code with me. But yes it''s possible.

One thing to keep in mind in your design, JNI calls are about 10 times slower than native language calls so try to keep the cross language communication to a minimum.

i.e Have c++ call a single java function, that does a lot of java processing, and returns. Rather than have have C++ call a single java function 1000 times a cycle. Java to Java calls = fast, C++ to c++ calls fast. Java to c++ slow(er), c++ to java slow(er).

He''s a bad motha - Shut yo mouth.

This topic is closed to new replies.

Advertisement