libGDX is mainly a Java-based framework. However, because Java produces Java bytecodes, and the virtual machine runs these bytecodes, it is possible to run libGDX in any JVM language with proper Java interoperability.
Some target platforms can’t run Java bytecodes directly, and so have more specific compilation requirements. Using a language other than Java may affect support for these platforms.
Language interoperability guides
- Python (Jython)
- Ruby (JRuby)
Target platform compatibility
This works out of the box, as the desktop libGDX back-end uses the JVM that you have installed on your computer, which is most likely either OpenJDK or Oracle JDK. Both of these JVMs support polyglot code, as they run on
.class files, not Java source code.
This works for many languages, but it is sometimes unavailable. For best results, search on your favorite search engine “[JVM language of choice] on Android”.
- Lein-droid for Clojure
- SBT-Android for Scala
- Kotlin on Android using the Kotlin plugin of IntelliJ IDEA Kotlin has full support for Android and Java 6, with the same codebase/featureset.
The ROBOVM backend is a JVM on iOS which executes Java bytecode. This should work, but has not been tested!
Many people have used libGDX in their JVM language of choice. Here are some examples.
TODO (find some recent examples, would love contributions!)