1
1

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にscala環境を構築します

Posted at

sbtのインストール

MacOSでは、Scalaプログラムを手動でコンパイルすることは非常に稀で、sbtという標準的なビルドツールを用いていること多いです。ここでは、まずsbtをインストールします。
Homebrewを用いてsbtをインストルします。

brew install sbt
# インストール済の情報
==> Downloading https://github.com/sbt/sbt/releases/download/v1.2.8/sbt-1.2.8.tgz
==> Downloading from https://github-production-release-asset-2e65be.s3.amazonaws.com/279553/ae845a00-0be0-11e9-99d2-03a5afa9f1c7?X-Amz-Algorithm=AWS4-HMAC-SHA2
######################################################################## 100.0%
==> Caveats
You can use $SBT_OPTS to pass additional JVM options to sbt.
Project specific options should be placed in .sbtopts in the root of your project.
Global settings should be placed in /usr/local/etc/sbtopts
==> Summary
🍺  /usr/local/Cellar/sbt/1.2.8: 521 files, 50MB, built in 58 seconds
  • sbtの場所: /usr/local/Cellar/sbt/1.2.8

REPLとsbt

これからしばらく、REPL(Read Eval Print Loop)機能と呼ばれる対話的な機能を用いてScalaプログラムを試して見ますが、それは常にsbt consoleコマンドを経由して行います。

# sbt consoleを起動
sbt console
scala> println("hello scala!") 
hello scala!

ここまでは、scalaのインストールが完了です。

scalaを終了したい場合は、以下のコマンドで

scala> :quit
1
1
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
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?