I tried everything I installed every possible Java file a million times I installed the newest gradle version but it continues to show this error. I'm on Mac. Please help thanks
Java 7. libGDX now requires Java 7. The only exception is the LWJGL 3 subproject, which requires Java 8. See #5839 for more information.
To Solve Could not determine java version from '11.0. 2' Error You need to upgrade wrapper using this command and just make sure Just Use gradle and not gradlew . gradle wrapper –gradle-version 5.1.
I am strongly recommend to use Java version not greater than 8. It is many incompatibility issues I faced just on 9 version of JDK in Android Dev environment.
Uninstall all java you have, use this article, because it is not as such easy without knowledge: https://www.java.com/en/download/help/mac_uninstall_java.xml
After download the 8th version from here: https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
I did same some time ago and all problems left
IF you do not want to develop for Android Java 11 works fine libgdx.
You have to change some things before everything builds and runs.
Here's what I did to get my project working.
My context Mac OSX 10.14 and openJDK 11.0.2
, new project, Desktop launcher and a bunch of Extensions (not important).
<project-dir>/gradle/wrapper/gradle-wrapper.properties
and change distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
into distributionUrl=https\://services.gradle.org/distributions/gradle-5.0-all.zip
.That resolves the java 11 error just to confront you with a new error Could not get unknown property 'classesDir' for main classes of type org.gradle.api.internal.tasks.DefaultSourceSetOutput.
To get rid of that, open <project-dir>/desktop/build.gradle
and change line 27 (might be different for you)from files(sourceSets.main.output.classesDir)
intofrom files(sourceSets.main.output.classesDirs)
thats classesDir
into classesDirs
This should resolve all build errors and you're good to go.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With