如何为Spring项目设置Visual Studio代码

时间:2019-08-21 01:40:52

标签: java spring visual-studio-code

我正在关注这个春季教程:https://spring.io/guides/gs/rest-service/

我想使用Visual Studio Code作为IDE。

在我的机器上安装了以下程序:

  • Java JDK 1.8.0_221
  • 5.6级
  • Maven 3.6.1

这些在VSC中安装的用于支持Java的扩展:

我注意到代码完成对于某些依赖项(例如org.springframework.boot)无法正常工作。

VSC显示带有以下警告的弹出窗口:

https://github.com/redhat-developer/vscode-java/wiki/"Classpath-is-incomplete"-warning

此外,我注意到Language Support for Java扩展引发了此错误:

[Error - 06:17:08] 21-ago-2019 6.15.10 Error occured while building workspace. Details: 
message: SpringBootApplication cannot be resolved to a type;code: 16777218
message: SpringApplication cannot be resolved;code: 570425394
message: The import org.springframework cannot be resolved;code: 268435846
message: The import org.springframework cannot be resolved;code: 268435846

如何解决上述错误并解决代码完成问题?

0 个答案:

没有答案