问题
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?
回答1:
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
.
来源:https://stackoverflow.com/questions/44093527/how-can-i-run-the-kotlin-repl-kotlinc-jvm-or-kotlinc