【问题标题】:Error: Spring Application Cannot be resolved错误:无法解决 Spring 应用程序
【发布时间】:2017-04-05 10:31:22
【问题描述】:

我试图在我的组织网络中创建 Gradle 项目以在 Eclipse 中与 Spring Boot 一起使用。但我无法创建它它给了我一个错误

"Exception in thread "main" java.lang.Error: Unresolved compilation problem: 
SpringApplication cannot be resolved at com.vidya.BootGradleApplication.main(BootGradleApplication.java:11)" 

请帮我解决这个问题。我附上了图片以便更多理解

【问题讨论】:

  • 依赖的spring jar好像没有下载,所以还是编译时出错。
  • 感谢您的回复。无论如何,我设法解决了错误。这是由于eclipse的gradle配置造成的。

标签: gradle spring-boot


【解决方案1】:

对于遇到此问题的其他人,这里有一些可能对您有所帮助的重要内容。

“如果 build.gradle 文件被更新,Eclipse 不会自动更新类路径。从项目的上下文菜单或你的 build.gradle 文件中选择 Gradle ▸ Refresh Gradle Project”

来自http://www.vogella.com/tutorials/EclipseGradle/article.html#updating-classpath-with-the-latest-changes-in-the-build-file

【讨论】:

    【解决方案2】:

    我正在使用 Vscode,这个问题浪费了我一个小时。

    解决Vscode这个bug的方法就是重启Vscode,这样它就可以更新项目了

    【讨论】:

      猜你喜欢
      • 2018-12-29
      • 2018-06-30
      • 2022-01-06
      • 1970-01-01
      • 2021-08-06
      • 2021-07-11
      • 1970-01-01
      • 2021-05-05
      • 1970-01-01
      相关资源
      最近更新 更多