Hi. So far I was doing `sdk install kotlin` to hav...
# kotlin-toolchain
j
Hi. So far I was doing
sdk install kotlin
to have the kotlin scripting support. Now with
kotlin
being replaced with kotlin-toolchain, what is the correct way of launching .main.kts scripts? (and how the shebang should look like)?
j
For now you can still use
sdk install kotlin
and then use the
kotlinr
executable instead of
kotlin
(since 2.4.10). We're also working on an experimental support for scripts with the Kotlin Toolchain, but I wouldn't count on this just yet. The command is
kotlin run --script foo.main.kts
(or just
kotlin run foo.main.kts
if you're not in a project)
👍 1
j
kotlinr
or
kotlinc
?
r
>
kotlinr
or
kotlinc
? @Jakub Gwóźdź kotlinlang.org/docs/command-line.html#… You can also use the
kotlinr
script to run binaries produced by the Kotlin compiler
👍🏼 1
j
Ah sorry, I had not finished my reply. Thanks Rey. I did mean
kotlinr
, it's the new name of the old
kotlin
executable ("kotlin runner") that you can use to run scripts (and in your shebang) when you also install the Kotlin Toolchain, so there is no conflict with the new
kotlin
executable from the toolchain.
👍 1