【发布时间】:2021-11-29 14:51:32
【问题描述】:
我花了最后 1.5 小时试图让 this simple tutorial 在 IntelliJ IDEA 中工作,正如您在 this video 中看到的那样。
尝试运行代码时,出现错误:
/[...] -Dfile.encoding=UTF-8 src.HelloKt
Error: Could not find or load main class src.HelloKt
Caused by: java.lang.ClassNotFoundException: src.HelloKt
我试过setting up SDK、invalidating cache、removing .idea and .gradle、rebuilding project、deleting the profile and adding it again。我以不同的顺序尝试了这些操作。
它还抱怨没有配置Kotlin,但我已经配置了它。
【问题讨论】:
-
@gidds 图片不是为了展示代码,而是项目结构和设置。
标签: kotlin intellij-idea