読者です 読者をやめる 読者になる 読者になる

HomebrewでScala2.10系を使う方法。

ソフトウェア開発 技術情報 Scala

悩んでいて解決したので情報共有。ただ、全部のコマンド履歴を取っていないので、抜けがあるかもしれない。他の情報も参考にしつつで読んでください。

brew tap homebrew/versions
brew search scala
  # homebrew/versions/scala210    homebrew/versions/scala29	    scala			  scalaenv			scalariform		      scalastyle
  # homebrew/science/scalapack    Caskroom/cask/scala-ide
brew install scala210
  # ==> Installing scala210 from homebrew/homebrew-versions
  # ==> Downloading https://homebrew.bintray.com/bottles-versions/scala210-2.10.5.yosemite.bottle.tar.gz
  # Already downloaded: /Library/Caches/Homebrew/scala210-2.10.5.yosemite.bottle.tar.gz
  # ==> Pouring scala210-2.10.5.yosemite.bottle.tar.gz
  # ==> Caveats
  # To use with IntelliJ, set the Scala home to:
  #   /usr/local/opt/scala210/idea
  # 
  # This formula is keg-only, which means it was not symlinked into /usr/local.
  # 
  # Conflicts with scala in main repository.
  # 
  # Bash completion has been installed to:
  #   /usr/local/etc/bash_completion.d
  # ==> Summary
  # 🍺  /usr/local/Cellar/scala210/2.10.5: 103 files, 32M
brew link --force scala210
  # Linking /usr/local/Cellar/scala210/2.10.5... 12 symlinks created
scala -version
  # Scala code runner version 2.10.5 -- Copyright 2002-2013, LAMP/EPFL

もし、2.11系を先にいれてしまっている場合は、2.10系インストールのあと「brew unlink scala」してから「brew link --force scala210」すればいいです。