LoginSignup
7
7

More than 5 years have passed since last update.

Mac + IntelliJ 13でScalaのHello Worldまで

Last updated at Posted at 2014-07-09

HomeBrewでscalaとsbtをインストール

brew install scala
brew install sbt

IntelliJのscalaプラグインとsbtプラグインをインストール

Intellij -> Preference -> plugins -> browse repositories
scalaプラグインとsbtプラグインを入れて再起動

HelloWorld実行

Intellij -> Create new project -> Scala -> SBT -> Helloworldとか適当に名前を付ける
Project SDKはJDKで良い?

生成されたプロジェクトのsrc>main>scalaの上で右クリック (srcフォルダが生成されるまで少し時間がかかります)
new>scala classでHelloScalaというクラスを作って以下をコピペ

import util.Properties

object HelloScala {
  def main(args: Array[String]) :Unit = {
    println("Hello, Scala!")
    println(Properties.versionString)
  }
}

HelloScalaを右クリック -> Runで実行

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