VS Code reported the warning that "the compiler compliance specified is 1.8 but a jre 18 is used" and I don't know how to solve it. I'm searching for more information but I can't find anything about this problem, I need help to solve it.
VS Code reported the warning that "the compiler compliance specified is 1.8 but a jre 18 is used" and I don't know how to solve it. I'm searching for more information but I can't find anything about this problem, I need help to solve it.
Here are three modification methods:
pom.xml file for the maven project <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>18</maven.compiler.source>
<maven.compiler.target>18</maven.compiler.target>
</properties>
.settings\org.eclipse.jdt.core.prefs file under the Java projecteclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=18
org.eclipse.jdt.core.compiler.compliance=18
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.forbiddenReference=ignore
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
org.eclipse.jdt.core.compiler.processAnnotations=enabled
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=18
settings.json "java.jdt.ls.java.home":"your_path_to_jdk18"