I am trying to run a Kotlin scratch file in IntelliJ, just like you are launching a scratch file in Java, but this will not work.
I created a new Kotlin scratch file, but I can’t run the code even after trying the following:
- Create a function
main
and type something inside. - Print anything with
println
out of the main function. - Create
class
with a function main
inside and println
something.
When I create a new kotlin project, the project works fine. The problem occurs only with files with scratches. I am using the kotlin plugin version 1.1.51 on IntelliJ 2017.1
As the screenshot shows, the icon that allows you to run kotlin code does not appear to the left of the editor window:

source
share