2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

[macOS][Kotlin]開発環境を用意する

Last updated at Posted at 2019-12-30

仕事でAndroidアプリケーションをKotlinで開発しているので、macOSでKotlinを試してみる。

KotlinといえばAndroidStudioでAndroidアプリケーションをプログラミングだと思うが、macOS上で動作するKotlinで書かれたプログラムを動かしたいので、開発環境としてIntelliJ IDEAを使うことにする。IntelliJ IDEAはUltimate EditionとCommunity Editionがあるか、Kotlinプログラミングの学ぶ目的なら、Community Editionで大丈夫だ。JetBrains社のWebサイト (https://www.jetbrains.com/ja-jp/idea/download/#section=mac) からダウンロードしよう。

download.png

IntelliJ IDEAが入手できたら、Java仮想マシンで動作するプログラムのプロジェクトを生成する。

新規プロジェクト.png

Kotlin_JVM.png

Project name.png

この状態では、Kotlinのソースファイルは作られていないので、srcフォルダを右クリックして、New > Kotlin File/Class を選択して、Kotlinファイルを生成する。

NewFile.png

Kotlin File.png

そして、hello, worldを印字するコードを書く。

fun main(args: Array) {
    println("hello, world")
}
run.png

<%=image 5, 'run', nil, [907,589]%>

hello, world と印字されている。

【関連情報】
Cocoa.swift

Cocoa勉強会 関東

Cocoa練習帳

2
2
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
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?