[英]No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK? in visual studio code
Below is the configuration in vscode.下面是vscode中的配置。 Although I have configured JDK in vscode, I am still getting the compilation error when I run maven install but maven test is working fine..
虽然我已经在 vscode 中配置了 JDK,但当我运行 maven install 但 maven test 工作正常时,我仍然遇到编译错误。
Please advise me how to resolve.请告诉我如何解决。
You need not configure "maven.terminal.useJavaHome"
, it depends on java.home
, but java.home
is deprecated for now.您无需配置
"maven.terminal.useJavaHome"
,它依赖于java.home
,但java.home
已弃用。
If you need to compile your projects against a different JDK version, it's recommended you configure the java.configuration.runtimes property in your user settings, eg:
如果您需要针对不同的 JDK 版本编译项目,建议您在用户设置中配置 java.configuration.runtimes 属性,例如:
"java.configuration.runtimes": [ { "name": "JavaSE-1.8", "path": "/path/to/jdk-8", }, { "name": "JavaSE-11", "path": "/path/to/jdk-11", }, { "name": "JavaSE-18", "path": "/path/to/jdk-18", "default": true }, ]
But it will not modify the Path
environment variable in the terminal, it will affect the Java extension, for example, the Run Java
button.但不会修改终端中的
Path
环境变量,会影响Java扩展名,例如Run Java
按钮。
And from the picture in your question and your comments, you need to download and install a JDK first and remember to add the bin folder of JDK to the Path
environment variable.而且从你问题中的图片和你的评论来看,你需要先下载并安装一个JDK,记得将JDK的bin文件夹添加到
Path
环境变量中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.