I've stumbled upon a strange thing in spring-fu. T...
# spring
c
I've stumbled upon a strange thing in spring-fu. Tests written in java using
var
, which is JDK10+ feature, while there is this in build.gradle.kts:
Copy code
tasks.compileJava {
	sourceCompatibility = "1.8"
	targetCompatibility = "1.8"
}
How does this work? My IntelliJ is swearing at me 🙂
c
tests are probably compiled via tasks.compileTestJava
c
but that one is not configured, so I assume 1.8 is used for both...
c
i think it stays at the default value
Copy code
JavaVersion sourceCompatibility
Java version compatibility to use when compiling Java source. Default value: version of the current JVM in use JavaVersion.
c
Ok, so that's resolved by specifying JDK 11 for gradle in IntelliJ settings.
Thank you, your comment nudged me in the direction of the solution.
c
yw! I do think that it should be specified in the gradle file, i was just guessing why it works for some people without.