5

I found this tutorial from JetBrains: https://www.jetbrains.com/help/idea/create-your-first-kotlin-app.html?section=Gradle%20Kotlin

It is dated August 19th, 2020.

I am using the same IntelliJ IDEA version as in their documentation: 2020.2.

However, my project creation wizard looks quite different from theirs.

They provide this screenshot:

enter image description here

But for me, it looks like this:

enter image description here

and when I click on Next: enter image description here

I don't see where I can choose the Console Application template, or Gradle.

I found a second tutorial - https://kotlinlang.org/docs/tutorials/jvm-get-started.html , which shows yet a third variation of the New Project wizard:

enter image description here

Are the tutorials out of date? Am I doing anything wrong? How do I create a Kotlin project, based on a console application template, with Gradle?

2
  • On the left menu, don't select Kotlin, select Gradle and then Kotlin/JVM on the right/main area. Enjoy Kotlin, it's a nice language. Commented Oct 10, 2020 at 21:02
  • @Augusto thanks, I try this, but I still don't get a list of templates... I get this: i.sstatic.net/Z9wFy.png Commented Oct 10, 2020 at 21:12

4 Answers 4

4

The wizard you have seems to be obsolete now. There was a brand-new one, released as a part of Kotlin 1.4 recently(see here).
Most probably, the problem is caused by the Kotlin IDE plugin being outdated or something. Please try to delete in and re-install using the Preferences -> Plugins menu. Comment here with the results, please. I'd like to know if this would help.

Sign up to request clarification or add additional context in comments.

Comments

4

Indeed it's quite weird, I've never seen the dialog to look like yours (mine looks like the one in the tutorials). However, choosing the template doesn't do anything special - it simply creates the main file, which you can do so yourself.

So create a new project with the "JVM/IDEA" option. If it already opens up a main.kt file, you don't need to do anything else. If it didn't, look in the src folder - you should see a folder named main with a folder named kotlin (with a blue icon instead of grey) inside - here's where you wanna create your main file (right click -> new kotlin file/class -> main.kt and make it a file, not a class). Finally, put this in the file:

fun main(args: Array<String>) { println("Hello world!") } 

Note: if you don't have a kotlin folder, create the file in the folder with the blue icon (might even be src). Also, if this doesn't use Gradle (for some reason), create a Gradle project instead, and at the "Additional libraries and frameworks" option, uncheck Java and check Kotlin, then continue with creating main.kt if it isn't created.

3 Comments

It works, thanks! I'd like to wait a couple of days before marking your answer as accepted, I'd like to give someone from JetBrains a chance to respond here. It would be good to know how to get my IntelliJ IDEA to offer the project templates...
@obe Check the other answer posted. Might have something to do with your issue. Also, it's very, very unlikely that someone from JetBrains will answer here - if you want that, they have their own support page.
I'm on a legacy support version of IntelliJ and this solution worked for me. Can't get the latest stuff.
1

You may create a Kotlin + gradle project from the terminal:

$mkdir myProject; cd myProject; gradle init 

follow the tutorial.

And then start the Intellij & open the dir You're good to go

Same process like this

Comments

0

The same happened to me but I figured out how to fix it:

Just disable Material Theme UI.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.