简体   繁体   English

无法在 intellij 运行配置中 select 主 class

[英]cannot select main class in intellij run config

I created a default kotlin project in intellij CE 2020.1 (latest).我在 intellij CE 2020.1(最新)中创建了一个默认的 kotlin 项目。

  1. File->New Project文件->新建项目
  2. Selected Java, Project SDK 14 (java version 14.0.1), Kotlin/JVM选择 Java,项目 SDK 14(java 版本 14.0.1),Kotlin/JVM
  3. Project src root is MyProject项目 src 根是 MyProject
  4. Project structure is MyProject->src->Main.kt项目结构为 MyProject->src->Main.kt
fun main(args: Array<String>) {
    println("Hello World!")
}

In Edit Configurations I try to select Main.kt's main and OK button is disabled.在编辑配置中,我尝试 select Main.kt 的主要和确定按钮被禁用。
Cannot run Main class in Intellij 无法在 Intellij 中运行 Main class

In edit > configurations > Main class it should say MainKt (yes, one word, uppercased K).edit > configurations > Main class ,它应该说MainKt (是的,一个单词,大写的 K)。 You can write it manually without browsing through project files.您可以手动编写它而无需浏览项目文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 IntelliJ 2021.2.3 中的 Kotlin 控制台应用程序 -&gt; 无法在运行/调试配置中添加主 class“MainKt” - Kotlin Console Application in IntelliJ 2021.2.3 -> Cannot add main class "MainKt" in Run/Debug configuration 如何在IntelliJ中运行Kotlin Koans? 什么是“主类”? - How to run Kotlin Koans in IntelliJ? What is the “Main class”? IntelliJ - 无法在混合(Java/Kotlin)模式下运行 Kotlin 类 - IntelliJ - cannot run Kotlin Class in mixed (Java/Kotlin) mode 在 IntelliJ Kotlin 项目中,当我尝试运行 java class 时,出现“无法找到或加载主类”错误 - In an IntelliJ Kotlin project, when I try to run a java class, I get a "Could not find or load main class" error IntelliJ IDEA:如何在 Kotlin 中指定主类? - IntelliJ IDEA: How to specify main class in Kotlin? Intellij 插件制作 package 和主要 class - Intellij plugin make package and main class Kotlin类文件无法在IntelliJ for JUnit中运行 - Kotlin class file can not run in IntelliJ for JUnit 错误:无法在 IntelliJ 中找到或加载主类 MainKt - Error: Could not find or load main class MainKt in IntelliJ 无法使用 IntelliJ 应用程序配置找到或加载主类 - Could not find or load main class with IntelliJ Application configuration IntelliJ Kotlin - MainKt 运行/调试配置不可用,无法运行项目 - IntelliJ Kotlin - MainKt run/debug configuration unavailable, cannot run project
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM