title: How to create Kotlin console application that would actually open in a console window
body: <p>I'm trying to create a Kotlin console app using IntelliJ Idea.</p>
  <p>For some reason it doesn't run as a console app.</p>
  <p>I'm using <strong>IntelliJ IDEA 2020.3.1</strong> (Community Edition) on <strong>Windows 10</strong>.</p>
  <p>What I do is as follows - I create a new Kotlin project out of the <em>&quot;Console Application&quot;</em> template. I choose <em>openjdk-15</em> as the <strong>Project JDK</strong>:
  <a href="https://i.stack.imgur.com/tIaPa.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tIaPa.png" alt="New Project" /></a>
  It generates a project consisting of a simple &quot;Hello world&quot; function:</p>
  <pre class="lang-kotlin prettyprint-override"><code>fun main(args: Array&lt;String&gt;) {
      println(&quot;Hello World!&quot;)
  }
  </code></pre>
  <p>When run it, it simply terminates (as expected) - without opening any console window though:
  <a href="https://i.stack.imgur.com/0qRw7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0qRw7.png" alt="console app completes immediately" /></a></p>
  <p>If I add some code that would require interaction from the user:</p>
  <pre class="lang-kotlin prettyprint-override"><code>fun main(args: Array&lt;String&gt;) {
      val name = readLine()
      println(&quot;Hello $name!&quot;)
  }
  </code></pre>
  <p>Once try to execute it, it builds but then hangs, never completing. Apparently it waits for the user input that's never submitted.</p>
  <p>This is understandable, but underlines the problem - so where's the console??</p>
  <p><a href="https://i.stack.imgur.com/Fs4CY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Fs4CY.png" alt="console-app-hangs-never-completing" /></a></p>
  <ul>
  <li>I tried to fiddle with &quot;Edit Configurations&quot;</li>
  <li>Do I possibly need a different JDK?</li>
  </ul>
  <p>What is the solution if I simply want to build a regular console application running in text mode? (Like one I could trivially create using Visual Studio.)</p>