JAVA_HOME:
PS C:\Users\Himanshu\Desktop\work\demo> $Env:JAVA_HOME
C:\Program Files\Java\jdk-17.0.1
Please see the above image. Why is it displaying Java 1.6 and in brackets pointing to java 17? This is also not compiling lambda functions.
Looks like a bug in VSCode.
EDIT: I switched to Intellij Idea. And it worked smoothly. It is using the JAVA_HOME. :)
Removing the following from pom.xml of my project fixed it:
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
</properties>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.