If this is your first time using libGDX, you’re at the right place. The following steps detail how you can get your fist libGDX project up and running.

Set Up a Dev Env - 图1

First off, you need an IDE (Integrated Development Environment). It is basically an editor for your java files, which makes developing java applications considerably more convenient in various ways. If you already have an IDE installed, you can skip to the next step.

The java world offers a lot of different IDEs. All of them will have minor advantages and disadvantages, but in the end they all do their job, so feel free to choose whichever you like most.

(1.) Android Studio

For newcomers wanting to not only target desktop, but mobile platforms as well, we recommend Android Studio.

(2.) IDEA

  • JDK 8+: there are different distributions, but Adoptium should fit your needs

    At the moment, libGDX projects do not work with JDK 16, as Gretty does not yet support Gradle 7. As a consequence, you are advised to use JDK 8-15!

  • IDE itself: IntelliJ IDEA (the “Community” edition is sufficient)

  • For Android: Android SDK
  • For iOS: RoboVM OSS IntelliJ plugin

(3.) Eclipse

  • JDK 8+: there are different distributions, but Adoptium should fit your needs

    At the moment, libGDX projects do not work with JDK 16, as Gretty does not yet support Gradle 7. As a consequence, you are advised to use JDK 8-15!

  • IDE itself: Eclipse

  • Android: not officially supported, but you may have success with Andmore or tinkering around with an older ADT version
  • For iOS: RoboVM OSS Eclipse plugin

(4.) NetBeans

As NetBeans is not commonly used in the libGDX community, it may prove difficult to get any help if IDE-specific issues arise.

  • JDK 8+: there are different distributions, but Adoptium should fit your needs

    At the moment, libGDX projects do not work with JDK 16, as Gretty does not yet support Gradle 7. As a consequence, you are advised to use JDK 8-15!

  • IDE itself: NetBeans & the NetBeans Gradle Plugin

  • Android: not officially supported
  • iOS: not officially supported

(5.) No IDE

It is also possible to develop libGDX applications entirely without any IDE, just using a simple editor like Notepad or Vim. This is not recommended, because IDEs provide some very convenient features, such as code completion and error checking. However, if you insist on doing so: libGDX applications are Gradle applications, so they can be built and executed via the commandline.

  • JDK 8+: there are different distributions, but Adoptium should fit your needs

    At the moment, libGDX projects do not work with JDK 16, as Gretty does not yet support Gradle 7. As a consequence, you are advised to use JDK 8-15!

  • For Android: Android SDK

  • Set the ANDROID_HOME environment variable, or use gradle.properties

Now that you have a development environment, you can create your very first libGDX project. libGDX offers a setup tool for that, which generates all the necessary files. To get started with it, take a look here.