If this is your first time using libGDX, you’re at the right place. The following article details how you can get your fist libGDX project up and running.
I. Getting a Proper Development Environment
First off, you need an IDE (Integrated Development Environments), basically an editor for your java files, which makes developing java applications more convenient in various ways. If you already have an IDE installed, you can skip to the next section.
The java world offers a lot of different IDEs, so feel free to choose whichever you like most:
- JDK 8+
- IDE itself: IntelliJ IDEA (community edition is sufficient)
- For Android: Android SDK
- For iOS: RoboVM OSS Intellij plugin
(2.) Android Studio
(5.) No IDE = Commandline
II. Creating a New Project
To setup your first project and download the necessary dependencies, libGDX offers a setup tool. See here on how to use it.
III. Finishing the project generation
Click generate. Now you’ll have a project all set up with a sample.
IV. Importing the Project
Lastly, you need to import your project into your IDE.
In IntelliJ IDEA or Android Studio, you can choose to open the
build.gradle file and select “Open as Project” to get started. In Eclipse, choose
File -> Import -> Gradle, in Netbeans
File -> Open Project.
You may need to refresh the Gradle project after the initial import, if some dependencies weren’t downloaded yet. In IntelliJ IDEA/Android Studio, the
Reimport all Gradle projects button is a pair of circling arrows in the Gradle tool window, which can be opened with
View -> Tool Windows -> Gradle. In Eclipse right click on your project
Gradle -> Refresh Gradle Project.
Now you can focus on getting your project running.