[英]How to not use gradle in IntelliJ to execute Kotlin main
I created a simple Kotlin project with the Console template in IntelliJ and running it I am getting the gradle-symbol in the run-toolwindow (cf. picture).我使用 IntelliJ 中的控制台模板创建了一个简单的 Kotlin 项目并运行它,我在运行工具窗口中获得了 gradle-symbol(参见图片)。
Usually I see in other tutorials that there is the Kotlin symbol so no gradle is used to run the main of the Kotlin-project.通常我在其他教程中看到有 Kotlin 符号,所以没有 gradle 用于运行 Kotlin 项目的主体。
Is there any possibility to change the way to run a Kotlin-main (despite the run configurations, which I took a look at, but did not find a way to change the "run-environment")是否有可能改变运行 Kotlin-main 的方式(尽管我查看了运行配置,但没有找到改变“运行环境”的方法)
I tried the solution:我尝试了解决方案:
CTRL + ALT + S to enter Settings
> Build, Execution, Deployment
> Build Tools
> Gradle
, switching Build and run using
to IntelliJ IDEA
, then getting the problem: CTRL + ALT + S 进入Settings
> Build, Execution, Deployment
> Build Tools
> Gradle
,将Build and run using
切换到IntelliJ IDEA
,然后得到问题:
Which is closer, but now it seems to get a problem as in Java, what I thought in Kotlin is no problem to have different file names then the actual code-content of the file.哪个更接近,但现在似乎在 Java 中遇到了问题,我在 Kotlin 中认为,文件名与文件的实际代码内容不同是没有问题的。
As described in Configure the build and run actions topic use Settings (Preferences on macOS) |如配置构建和运行操作主题中所述,使用设置(macOS 上的首选项)| Build, Execution, Deployment |构建、执行、部署 | Build Tools |构建工具 | Gradle | Gradle | Build and run using: option and switch it to IntelliJ IDEA :使用: 选项构建和运行并将其切换到IntelliJ IDEA :
CTRL + ALT + S to enter Settings
then in the left panel choose Build, Execution, Deployment
> Build Tools
> Gradle
, find Build and run using
and pick IntelliJ IDEA
CTRL + ALT + S 进入Settings
然后在左侧面板中选择Build, Execution, Deployment
> Build Tools
> Gradle
,找到Build and run using
并选择IntelliJ IDEA
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.