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
/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
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
$ tar -xzf scala-2.9.0.1.tgz
step 3. move scala-X.XX.tgz
to /usr/local
folder
sudo cp -R scala-2.9.0.1 /usr/local/scala
Step 4. Open your .bash_profile
file
sudo open -e ~/.bash_profile
Step 5. Add scala/bin path to your PATH
export PATH=/usr/local/scala/bin:$PATH
Step 6. reload .bash_profile from the command line
source ~/.bash_profile
Finally verify scala
$ 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>
Leave a Reply