I am using IntelliJ IDEA 2021.2.3 , JDK 17. I have code snippet in Java 17
pom.xm
4.0.0 org.example function_programming17 1.0-SNAPSHOT function_programming17 http://www.example.com UTF-8 17 17 junit junit 4.11 test maven-clean-plugin 3.1.0 maven-resources-plugin 3.0.2 maven-compiler-plugin 3.8.0 maven-surefire-plugin 2.22.1 maven-jar-plugin 3.0.2 maven-install-plugin 2.5.2 maven-deploy-plugin 2.8.2 maven-site-plugin 3.7.1 maven-project-info-reports-plugin 3.0.0 package org.example; import java.time.LocalDate; import java.util.function.Supplier; /** * Hello world! */ public class App { public static void main(String[] args) { System.out.println("Hello World!"); Supplier localDateSupplier = LocalDate::now; Supplier localDateSupplier1 = () -> LocalDate.now(); LocalDate localDate = localDateSupplier.get(); LocalDate localDate1 = localDateSupplier1.get(); System.out.print("localDate = "); System.out.println(localDate); System.out.print("localDate1 = "); System.out.println(localDate1); } } Error
java: invalid source release 7 with --enable-preview (preview language features are only supported for release 17)

How to fix it?
Источник: https://stackoverflow.com/questions/700 ... w-language