I recently made a simple user input code in kotlin and I tried to run it on intellij Idea, but it didn't work properly, when I ran the code, the "Enter text" part showed up and I can type some words, but the readLine() didn't seem to work as it doesn't continue to the last println statement.
this is the contents of my main.kt file
fun main(args: Array<String>) {
print("Enter text: ")
val stringInput = readLine()!!
println("You entered: $stringInput")
}
here is the contents of my build.gradle.kts file
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
kotlin("jvm") version "1.4.20"
application
}
group = "me.rakandhiya"
version = "1.0-SNAPSHOT"
repositories {
mavenCentral()
}
dependencies {
testImplementation(kotlin("test-junit"))
}
tasks.test {
useJUnit()
}
tasks.withType<KotlinCompile>() {
kotlinOptions.jvmTarget = "1.8"
}
application {
mainClassName = "MainKt"
}
is there anything wrong in those 2 files?