Skip to content

A complete Kotlin course covering basics to advanced concepts with hands-on examples and exercises for Android and backend development.

Notifications You must be signed in to change notification settings

Abdullah-Niaz/Kotlin-Complete-Course

Repository files navigation

Kotlin-Complete-Course

Kotlin Compiler Commands Table (Windows, Linux, macOS)

Task Command Description
Check Kotlin Version kotlinc -version Verifies Kotlin installation.
Compile Kotlin File kotlinc filename.kt Compiles the file into bytecode (filename.class).
Run Compiled Class kotlin filenameKt Runs the compiled Kotlin file.
Compile with Runtime kotlinc filename.kt -include-runtime -d filename.jar Creates a .jar file including the runtime.
Run JAR File java -jar filename.jar Runs the compiled JAR file.
Run Kotlin Script kotlin filename.kt Executes a Kotlin script without compiling.
Compile Multiple Files kotlinc file1.kt file2.kt -d output.jar Compiles multiple Kotlin files into one JAR.
Enable Debugging kotlinc -J"-Xdebug" filename.kt Compiles with debugging enabled.
Run REPL (Interactive Mode) kotlinc Opens an interactive Kotlin shell.
Exit REPL :quit Exits the interactive mode.

Example Workflow

  1. Write a simple Kotlin program (hello.kt):
    fun main() {
        println("Hello, Kotlin!")
    }
  2. Compile the file:
    kotlinc hello.kt -include-runtime -d hello.jar
  3. Run the compiled JAR:
    java -jar hello.jar

Now you can easily compile and run Kotlin programs! 🚀 Let me know if you need help. 😊

About

A complete Kotlin course covering basics to advanced concepts with hands-on examples and exercises for Android and backend development.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages