gpt4 book ai didi

java - 在 IntelliJ 的 Spring Boot 配置中“更正应用程序的类路径”

转载 作者:行者123 更新时间:2023-12-04 08:31:30 25 4
gpt4 key购买 nike

我有一个带有 IntelliJ-Idea IDE 的应用程序,它的 Springboot 配置出错并给出以下建议:

The following method did not exist:

org.springframework.context.ConfigurableApplicationContext.setApplicationStartup(Lorg/springframework/core/metrics/ApplicationStartup;)V

The method's class, org.springframework.context.ConfigurableApplicationContext, is available from the following locations:

jar:file:/C:/Users/tlmitch/.m2/repository/org/springframework/spring-context/5.2.8.RELEASE/spring-context-5.2.8.RELEASE.jar!/org/springframework/context/ConfigurableApplicationContext.class

Correct the classpath of your application so that it contains a single, compatible version of org.springframework.context.ConfigurableApplicationContext
我对 IntelliJ-Idea 和 Springboot 比较陌生。如果这是 Eclipse - 我可能只是转到 Java Build Path 并添加包含该类的 jar 文件。
我对 IntelliJ 不太熟悉。到目前为止,如果缺少某些东西,我只是在运行“npm install”,这通常会解决它。
有什么建议?
非常感谢

最佳答案

正如错误所暗示的那样:

Correct the classpath of your application so that it contains a single, compatible version of org.springframework.context.ConfigurableApplicationContext
你需要确保你的类路径只包含一个这样的类。您可以使用导航 |类操作查看项目中是否存在该类的多个版本并排除Maven中重复的库依赖 pom.xml文件。

关于java - 在 IntelliJ 的 Spring Boot 配置中“更正应用程序的类路径”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64997286/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com