I've set the language level to 8 in the IntelliJ project settings, and I've also tried setting it in gradle like this:
buildscript {
ext.kotlinVersion = '1.3.41'
repositories {
mavenLocal()
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
jcenter()
google()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
}
}
allprojects {
version = '1.0'
ext {
appName = "VolumeFlux"
gdxVersion = '1.9.10'
roboVMVersion = '2.3.8'
box2DLightsVersion = '1.4'
ashleyVersion = '1.7.0'
aiVersion = '1.8.0'
visuiVersion = '1.4.2'
}
repositories {
mavenLocal()
mavenCentral()
jcenter()
google()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
maven { url "https://oss.sonatype.org/content/repositories/releases/" }
}
apply plugin: 'java'
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
subprojects {
apply plugin: 'java'
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
project(":desktop") {
apply plugin: "kotlin"
dependencies {
implementation project(":core")
api "com.badlogicgames.gdx:gdx-backend-lwjgl:$gdxVersion"
api "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
api "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-desktop"
api "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-desktop"
api "com.badlogicgames.gdx:gdx-tools:$gdxVersion"
api "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
}
}
project(":core") {
apply plugin: "kotlin"
dependencies {
api "com.badlogicgames.gdx:gdx:$gdxVersion"
api "com.badlogicgames.gdx:gdx-box2d:$gdxVersion"
api "com.badlogicgames.gdx:gdx-freetype:$gdxVersion"
api "com.kotcrab.vis:vis-ui:1.3.0"
api "com.github.czyzby:gdx-kiwi:1.9.1.9.6"
api "net.dermetfan.libgdx-utils:libgdx-utils:0.13.4"
api "com.badlogicgames.ashley:ashley:$ashleyVersion"
api "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
compile "com.kotcrab.vis:vis-ui:$visuiVersion"
}
}
But for some reason I still get a gradle build error:
...\VolumeFlux.java:79: error: lambda expressions are not supported in -source 7
stockButtons.forEach(b -> {
^
(use -source 8 or higher to enable lambda expressions)