snippetbashTip
kotlinc — Kotlin compiler. More information: <https://kotlinlang.org/docs/compiler-reference.html#common-optio
Viewed 0 times
httpscommandkotlincclikotlininformationcompilermore
Problem
How to use the
kotlinc command: Kotlin compiler. More information: <https://kotlinlang.org/docs/compiler-reference.html#common-options>.Solution
kotlinc — Kotlin compiler. More information: <https://kotlinlang.org/docs/compiler-reference.html#common-options>.Start a REPL (interactive shell):
kotlincCompile a Kotlin file:
kotlinc {{path/to/file.kt}}Compile several Kotlin files:
kotlinc {{path/to/file1.kt path/to/file2.kt ...}}Execute a specific Kotlin Script file:
kotlinc -script {{path/to/file.kts}}Compile a Kotlin file into a self contained jar file with the Kotlin runtime library included:
kotlinc {{path/to/file.kt}} -include-runtime -d {{path/to/file.jar}}Code Snippets
Start a REPL (interactive shell)
kotlincCompile a Kotlin file
kotlinc {{path/to/file.kt}}Compile several Kotlin files
kotlinc {{path/to/file1.kt path/to/file2.kt ...}}Execute a specific Kotlin Script file
kotlinc -script {{path/to/file.kts}}Compile a Kotlin file into a self contained jar file with the Kotlin runtime library included
kotlinc {{path/to/file.kt}} -include-runtime -d {{path/to/file.jar}}Context
tldr-pages: common/kotlinc
Revisions (0)
No revisions yet.