kotlinc
kotlin compiler
TLDR
Compile Kotlin file
SYNOPSIS
kotlinc [options] files
DESCRIPTION
kotlinc is the command-line Kotlin compiler that translates Kotlin source files (.kt) into JVM bytecode. It can produce either standalone JAR files with the Kotlin runtime bundled via the `-include-runtime` flag, or output class files to a directory for integration with existing build pipelines.
The compiler supports full interoperability with Java, allowing Kotlin code to call Java libraries and vice versa. It accepts a target JVM version through the `-jvm-target` option, supports adding external dependencies via the classpath, and can compile multiple source files together. For larger projects, build tools like Gradle or Maven are typically preferred, but kotlinc is useful for quick compilation tasks, learning, and scripting workflows.
PARAMETERS
FILES
Kotlin source files (.kt).-d OUTPUT
Output JAR or directory.-include-runtime
Include Kotlin runtime.-cp PATH
Classpath.-jvm-target VERSION
Target JVM version.-no-stdlib
Don't include stdlib.--help
Display help information.
CAVEATS
Requires JVM. Slow startup. Consider Gradle for projects.
HISTORY
kotlinc is the official compiler for Kotlin, created by JetBrains as a modern JVM language.
