In this Post we will see How to Install Scala on Mac OS X.
There are Two ways using which we can install Scala.
- Install Scala using homebrew installer.
- Or Install scala manually
Install Scala using homebrew installer
Step 1 . Install Homebrew
Open the terminal and run
1 |
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" |
The above command may change in future, to please visit http://brew.sh/ for the most latest command to install homebrew.
Step 2. Install scala
1 |
brew install scala |
Install scala manually
Step 1. Download scala-X.XX.tgz zip file from the official website.
Step 2. Unzip the .tgz file. open terminal and run
1 |
$ tar -xzf scala-2.9.0.1.tgz |
step 3. move scala-X.XX.tgz
to /usr/local
folder
1 |
sudo cp -R scala-2.9.0.1 /usr/local/scala |
Step 4. Open your .bash_profile
file
1 |
sudo open -e ~/.bash_profile |
Step 5. Add scala/bin path to your PATH
1 |
export PATH=/usr/local/scala/bin:$PATH |
Step 6. reload .bash_profile from the command line
1 |
source ~/.bash_profile |
Finally verify scala
1 2 3 4 5 6 7 |
$ scala Welcome to Scala version 2.9.0.1 (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_24). Type in expressions to have them evaluated. Type :help for more information. scala> |
Video Instructions – How to install Scala on Mac OS X