4

While trying to build my application using features from Java 11 (var), I keep getting the error message explaining 'cannot find symbol: var ex = new ClassName(); symbol: class var'

I'm using IntelliJ 2019.2.1 Community and Oracle Java 11.0.4, I have already tried this but it seems to be a solution for Maven, but not for Gradle.

I expect, since I set the JDK version to 11 and the Language Level to 11 to just work, but it doesn't.

1 Answers1

5

Add sourceCompatibility = '11' to your build.gradle file, and refresh gradle in IDEA.

Max Farsikov
  • 2,451
  • 19
  • 25