How can I run the Kotlin REPL kotlinc-jvm or kotlinc

ε祈祈猫儿з 提交于 2021-01-27 05:44:09

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!