有什么方法可以避免错误ClassNotFoundException(Spring Initializr)?

问题描述 投票:0回答:1

当我生成Gradle-Kotlin-Spring Boot项目并在Intellij Idea中启动它时,我收到错误消息:

错误:找不到或加载主类com.example。%someClassNameKt%由以下原因引起:java.lang.ClassNotFoundException:com.example。%someClassNameKt%

没有进行其他设置。

我试图指出将主类放置在构建脚本中:

application {
    mainClassName = "com.example.%someClassNameKt%"
}

但是没有用。

是已知错误还是如何避免此错误?

我确实检查了很多类似的问题,但没有帮助

spring-boot kotlin classnotfoundexception
1个回答
0
投票

您不需要在mainClassName中使用'%',这可能会导致错误。

© www.soinside.com 2019 - 2024. All rights reserved.