Before I ask, I have looked around and I do not see any other questions with similar problems as I, Currently I'm using the nightly build of LibGDX with Gradle and everytime I try to set the java language level to 7.0 or even 8.0 it refreshes gradle and then forces the language level back to 6.0, everything i read states that gradle has no control over the language level, yet that's when it forces a change, is there something that I am over looking? I've tried using File | Project Structure | Project Language Level, I've tried setting each module to 7.0 and I've tried setting the default language level for intellij, only reason I need 7.0 is for the ability to use the string type for a switch case. Any help would be greatly appreciated.
You need to set the language level in the Gradle build script (e.g. sourceCompatibility = 1.7
).
I was hitting a similar problem with trying to use Java 8 for a desktop-only build. I had to add the following to the desktop and core sections to get it working:
compileJava {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
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