Skip to content

Instantly share code, notes, and snippets.

@FATESAIKOU
Last active May 20, 2025 23:22
Show Gist options
  • Save FATESAIKOU/e5e203c18346be5b14d6003567c50afc to your computer and use it in GitHub Desktop.
Save FATESAIKOU/e5e203c18346be5b14d6003567c50afc to your computer and use it in GitHub Desktop.
kotlin basic
# kt
## Source file
cat hello.kt <<EOF
fun main() {
println("Hello, Kotlin!")
}
EOF
## Compile
kotlinc hello.kt -include-runtime -d hello.jar
## Execute
java -jar hello.jar
# kts(script)
## Source file
cat hello.kts <<EOF
println("Hello from script!")
EOF
## Execute
kotlin hello.kts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment