java VSCode指定的编译器兼容性为1.8,但使用了JRE 17

9vw9lbht  于 2023-09-29  发布在  Java
关注(0)|答案(2)|浏览(420)

i have this problem on vscode for a java project. i've also other java projects, but they're not giving me any problems. this is the only one with this issue. can anyone help to solve this?
我已经尝试在vs代码中将java安装路径添加到java主页设置中。但什么都没发生

xsuvu9jc

xsuvu9jc1#

您必须更新pom.xml文件中的版本,然后更新项目配置以应用更改。

ig9co6j1

ig9co6j12#

阅读this document开始学习java。
此配置可以设置JDK

"java.configuration.runtimes": [
  {
    "name": "JavaSE-1.8",
    "path": "/usr/local/jdk1.8.0_201"
  },
  {
    "name": "JavaSE-11",
    "path": "/usr/local/jdk-11.0.3",
    "sources" : "/usr/local/jdk-11.0.3/lib/src.zip",
    "javadoc" : "https://docs.oracle.com/en/java/javase/11/docs/api",
    "default":  true
   },
   {
    "name": "JavaSE-12",
    "path": "/usr/local/jdk-12.0.2"
   },
]

相关问题