Kotlin未解决IntelliJ中的参考问题

编程入门 行业动态 更新时间:2024-10-24 08:27:12
本文介绍了Kotlin未解决IntelliJ中的参考问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我开始使用教程以 IntelliJ 。当我尝试运行示例时,

I started off with the tutorial for learning Kotlin in IntelliJ.When I tried running the example i.e

fun main(args: Array<String>) { println("lol") }

暂停执行使用此消息错误:(5,5)Kotlin:未解决的参考:println 这是我第一次使用IntelliJ.I从未使用过 Java 项目。我遗失了什么?

Execution is suspended with this messageError:(5, 5) Kotlin: Unresolved reference: println This is the first time I am using IntelliJ.I have never worked on a Java project either.Am I missing something?

编辑:我见过其他问题已经答案对我的情况无效。

I have seen the other question already.The answer is not valid for my situation.

推荐答案

您在项目中使用的Intellij IDEA插件和Kotlin运行时/编译器需要匹配。例如,如果IDE插件是Beta 1,但是使用M12的Gradle / Maven项目,则会出现与您所描述的完全相同的问题。因此请检查所有内容是否排成一行。

Your Intellij IDEA plugin and the Kotlin runtime/compiler that you use in the project need to match. For example if IDE plugin is Beta 1, but your Gradle/Maven project using M12, you'll have issues exactly as you described. So check that everything lines up.

如果仍有问题,使用一些较旧的插件则需要清除Intellij IDEA中的缓存(文件菜单,清除缓存和重启,选择重启的选项。)

If you still have issues, with some older plugins you need to clear the caches in Intellij IDEA (file menu, Clear Caches and Restart, select option to restart).

更多推荐

Kotlin未解决IntelliJ中的参考问题

本文发布于:2023-11-07 06:35:19,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1565783.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Kotlin   IntelliJ

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!