Files
tldr/pages.zh/common/kotlinc.md

24 lines
536 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# kotlinc
> Kotlin 编译器。
> 更多信息:<https://kotlinlang.org/docs/command-line.html>。
- 启动 REPL交互式 shell
`kotlinc`
- 编译 Kotlin 文件:
`kotlinc {{path/to/file.kt}}`
- 编译多个 Kotlin 文件:
`kotlinc {{path/to/file1.kt path/to/file2.kt ...}}`
- 执行特定的 Kotlin 脚本文件:
`kotlinc -script {{path/to/file.kts}}`
- 将 Kotlin 文件编译成一个包含 Kotlin 运行时库的自包含 jar 文件:
`kotlinc {{path/to/file.kt}} -include-runtime -d {{path/to/file.jar}}`