LoginSignup
0
0

More than 5 years have passed since last update.

KotlinをCLIから試す

Last updated at Posted at 2018-05-05

IDEを使わず、kotlinのシンタックスを確認するために、最小構成でKotlinを書くためのメモ。

Kotlinをインストール

kotlinが入っていない場合はインストール

❯ brew update
❯ brew install kotlin

コードを書く

❯ cat hello.kt
fun main(args: Array<String>) {
    println("Hello, World!")
}

コンパイル

❯ kotlinc hello.kt -include-runtime -d hello.jar
❯ ll
total 1712
-rw-r--r--  1 nakayama  staff   849K  5  5 20:58 hello.jar
-rw-r--r--  1 nakayama  staff    64B  5  5 20:57 hello.kt

実行

❯ java -jar hello.jar

Hello, World!

参考

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0