【发布时间】:2020-10-28 16:16:05
【问题描述】:
由于参数无效导致编译失败,我无法执行简单的 Kotlin 脚本。
这是我的 Kotlin 脚本:
#!/usr/bin/env kscript
println("Helloooo")
然后我编写了非常简单的脚本,我添加了可执行权限来执行它:
chmod u+x SomeScript.kts
这是错误:
$ ./SomeScript.kts
[kscript] [ERROR] compilation of './SomeScript.kts' failed
error: invalid argument: -d
info: use -help for more information
我该如何解决?
【问题讨论】:
-
解决了!我已经通过 Homebrew 正确安装了 kscript,但由于某种原因,只有
kotlinc不在 PATH 中。我添加了它,现在它可以工作了!
标签: kotlin scripting kotlin-script