Search code examples
javagradlelibgdxversiongenerator

LibGDX JDK Version


I've wanted to create a game with libGDX recently. So I installed Oracle's JDK 12.0.1, downloaded libGDX's gradle-based project creation tool, and just tried to create a project at first. Hit generate button, it started to install gradle-4.6 version and failed to build cause gradle-4.6 does not support java 12.0.1. So my question is, how can I change the preferred gradle version and will the change solve my issue? Or do I have to work with JDK 8 for example because of Android.

Thx in advance.


Solution

  • Refering to https://libgdx.badlogicgames.com/documentation/gettingstarted/Setting%20Up.html, libGDX should support java 12 (if you don't want to export on Android, if so I would rather consider working with the JDK 8).

    To remove the problem with gradle you just have to change inside the file located in project/gradle/wrapper/gradle-wrapper.properties, and change the distribution to distributionUrl=https\://services.gradle.org/distributions/gradle-5.4-all.zip