$ brew install kotlin
$ kotlin -version
=> Kotlin version 1.3.61-release-180 (JRE 11.0.1+13-LTS)
helloWorld.kt
fun main(args: Array<String>) {
println("Hello, World!")
}
$ kotlinc helloWorld.kt -include-runtime -d helloWorld.jar
$ hello_world ll
-rw-r--r-- 1 user staff 1.3M Dec 27 22:34 helloWorld.jar
-rw-r--r-- 1 user staff 62B Dec 27 22:33 helloWorld.kt
java
command$ java -jar helloWorld.jar
=> Hello, World!
Hello, World!
Recommended Posts