将Kotlin配置为IntelliJ中的现有项目 [英] Configure Kotlin to an existing project in IntelliJ

查看:163
本文介绍了将Kotlin配置为IntelliJ中的现有项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通过intelliJ创建了一个kotlin新的Kotlin项目( https://github .com/dhananjay12/kotlin/tree/master/kotlin-basic ).然后,我从另一台计算机将其导入IntelliJ.

I created a kotlin new Kotlin project through intelliJ (https://github.com/dhananjay12/kotlin/tree/master/kotlin-basic) a while back. I then imported it into IntelliJ from a different machine.

没有运行选项即将出现:

There is no run option coming :

我仍然尝试使用Project SDK和库进行配置,但是IntelliJ仍无法将其识别为kotlin项目.

I tried to configure using Project SDK and Libraries, still, IntelliJ doesn't recognize it as a kotlin project.

注意-新项目完全正常

如何为Kotlin配置现有项目?

How do I configure an existing project to Kotlin?

哪些文件需要保存在git中,以便不需要手动配置IDE?

What files need to be saved in git so that manually configuring IDE is not required?

推荐答案

1)右键单击src文件夹

2)将目录标记为Sources Root

3)将要求您为该模块配置Java SDK和Kotlin插件.做吧.

3) Will ask you to configure Java SDK and Kotlin Plugin for the module. Do it.

4)运行&享受

4) Run & enjoy

这篇关于将Kotlin配置为IntelliJ中的现有项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆