I am using Micronaut2.0.2 application with IntelliJ IDE 2020.2.2. I have enabled the preview feature in from the language level in IDE
And in the Gradle file I have the below option
java {
sourceCompatibility = JavaVersion.toVersion('14')
targetCompatibility = JavaVersion.toVersion('14')
}
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
options.compilerArgs.addAll([
'-parameters',
// enables incremental compilation
'-Amicronaut.processing.incremental=true',
'-Amicronaut.processing.annotations=fete.bird.*',
"-Amicronaut.processing.group=$project.group",
"-Amicronaut.processing.module=$project.name",
"--enable-preview"
])
}
Getting an error as error: invalid source release 14 with --enable-preview
Set Settings (Preferences on macOS) | Build, Execution, Deployment | Build Tools | Gradle | Gradle JVM to 14 JDK version.