Is it possible to use Java as a scripting language for a C++ engine/game?
I understand that you need to make a binding to the interpreter, but I haven't seen any around.
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It only takes a minute to sign up.Sign up to join this community
You could probably use the GNU Interpreter for Java or some other such system. However I think you'll find a lot more cases (as mentioned above) of people using Lua, Python or other languages in games. Lua in particular is very well suited for the task of embedded scripting.
Additionally, you might check the jog interpreter project, which touts itself as, "...a lightweight but reasonably full-featured and fast Java compiler and interpreter." that is written in C++.
Amusingly, googling for "java interpreters in C++" seems to yield as many (if not more) hits for C++ interpreters written in Java instead of the other way around :)
Yes, it's possible. Way back in 1999, an article was published in Game Developer on the subject, entitled "Dirty Java: Using the JNI Within Games." I still have my copy of issue in fact. Fortunately the article also appears to be available online. Of course, the code in that article is probably a tad out of date, so you can also check out these articles as well:
Yes it is possible. Game Vampire the Masquerade - Redemption uses Java as a scripting language. And that game is the only serious game i know of using Java. Bear i mind, they are not using Java for their Nod engine.
Edit: There is JMonkeyEngine written completely in Java.
Bohemia Interactive (BIS) has announced that Arma3 will use Java as it's scripting language. BIS will be introducing their Java scripting engine in the next patch for Take On Helicopters.
MMORPG Darkfall Online uses Java as a scripting engine.
Yes it is possible.
However if you are looking for a JVM langauge for scripting, I'd probably recommend either Clojure or Groovy over Java itself - both are dynamic langauges that are better suited for the interactive development style that you usually want with scripting langauges.