I am using IntelliJ for the first time to write a Kotlin program for windows.
I need to read a file so I used code from a sample site:
import java.io.File
import java.io.InputStream
fun main(args: Array<String>) {
val inputStream: InputStream = File("bezkoder.txt").inputStream()
val lineList = mutableListOf<String>()
inputStream.bufferedReader().useLines { lines -> lines.forEach { lineList.add(it)} }
lineList.forEach{println("> " + it)}
}
The thing is that it doesn't recognise the import for the java classes.
I guess it is something in my setup but I have no idea where to look and haven't managed to find an answer.
This is my SDK setup screen