LibGDX Setup
Last time I started a project with libGDX I used this tool to generate the project and I was coding my game in no time. You shouldn't need Android SDK or other stuff if you only select Desktop platform. If you check the libGDX docs, they seem to recommend it as well.
Hope you find it helpful.
The official instructions are here: https://github.com/libgdx/libgdx/wiki/Project-Setup-Gradle
Basically just download Eclipse and the setup-jar.
When you run the jar it'll present you with a wizard. Just fill in the name, package, game-class and output location (ignore the android SDK field). Then untick Android, IOS and HTML subprojects. You probably won't need any of the extensions either. And then hit 'Generate'.
From Eclipse you need to go to File -> Import -> Gradle -> Gradle Project.
That is assuming you have a recent version of Eclipse for Java which pre-bundles the Buildship plugin. If not you won't see the Gradle option in the import dialog and you will first need to install the Buildship plugin for Eclipse (Find it in the Eclipse Marketplace under the Help menu).
And that's it! You're ready to go.
Find your main class in the Desktop project. Run it from Eclipse as a Java Application.
It should give you a window with a picture in it; when you look at the source code this is just the default application that gets generated by the setup tool to get you going.
David Gill :: GitHub :: twitter .
I advice against Eclipse, worked with it for years but to step away from it was the best decision i ever made. I work in Android Studio now for all my java projects, also none android projects but you can use Jetbrains Intelij (which AS is based upon) as well. I used to run in lots of IDE problems using Eclipse and AO just seems to work, and if it doesn't on a rare occasion there either is a button to auto-fix or the fix is easy to solve. It takes some time to get used to but it is well worth the time.
To start a project for LibGDX in AS just create a project with the LibGDX setup app. Then just click File->New->Import Project and get going. You do need to install the android SDK, you can however do this within AS. To run a desktop project from your LibGDX you have to:
- Go to Run/Debug Configurations
- Click the + and add Application
- Select Desktop as classpath or module
- Now set DesktopLauncher as main class (first to run)
- And the working directory preferably needs to point to your assets folder, this usally is in the android module if you created one with the LibGDX setup.