I am completely new to Kotlin, and I am trying to run the Kotlin REPL.
Following this, and considering I am using OS X, and I have tried this:
$ /usr/local/bin/kotlinc-jvm
which is equivalent to:
$ kotlinc-jvm
Then in the following link, I found that a nicer way to run it is:
$ kotlinc
Is there any differences between this two commands, and which one should I choose?
Each release of Kotlin includes compilers for the supported targets: JVM, JavaScript, and native binaries for supported platforms. These compilers are used by the IDE when you click the Compile or Run button for your Kotlin project.
Kotlin lets you choose the version of JVM for execution. By default, the Kotlin/JVM compiler produces Java 8 compatible bytecode.
Kotlin IDE for Visual Studio Code To use, make sure that JDK 11+ is installed and open a Kotlin file inside a Gradle or Maven project. Support for Kotlin source files with a standalone compiler ( kotlinc ) is experimental. The language server will then automatically launch in the background.
If you look inside the kotlinc-jvm
files, they actually just launch the kotlinc
that's in the same folder they are in, and pass any arguments they were started with to it:
kotlinc-jvm
for Unix:
#!/usr/bin/env bash
# (License here)
DIR="${BASH_SOURCE[0]%/*}"
: ${DIR:="."}
"${DIR}"/kotlinc "$@"
kotlinc-jvm.bat
for Windows:
@echo off
rem (License here)
call %~dps0kotlinc.bat %*
I'm not sure why kotlinc-jvm
is there in this form, it's basically just a very simple redirect. I'd just use kotlinc
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With