Mac OS
Last updated
Last updated
This document will guide you through setup on Mac OSX so you'll be ready to do the course exercises, and optionally, continue exploring Scala after you're done.
Open Spotlight by clicking the magnifying glass icon on the upper right corner of your screen
Type terminal
in the search box
Click the Terminal application entry to launch your terminal session:
You will see a window that looks like this:
You'll use this terminal window to complete the rest of this installation guide.
Recent versions of Mac OS come with Java already installed. Confirm that your computer has Java installed by typing:
at the command prompt in your terminal window. You should see a response similar to:
Note: the $
represents the command prompt. It may look different in your terminal.
You need Java version 1.8 or higher in order to run Scala 2.12. If the version of Java installed on your computer is older than 1.8, use your Mac's Software Update utility to upgrade to the current version before continuing.
Download the ZIP file here. Unzip the project and navigate inside the unzipped directory (called creative-scala-template
) from the terminal. Make sure you can do the following (this will take a little while the first time you do it).
An image of three circles should appear!
If you wish to go beyond using doodle and create projects of your own, or just play around in the REPL, you will want to have Scala and SBT installed. This section walks you through how to do this.
Homebrew is a software package manager for Mac OS. To install Homebrew, paste the following line at your terminal prompt:
and follow the instructions in the installation script.
You will see output like this in your terminal:
Verify that Homebrew is installed by typing
Now that you have brew installed, you can get the latest version of scala very easily:
Now you should be able access the Scala REPL:
(note: ignore the warning cat: /release: No such file or directory
)
Type
at the scala>
prompt to see instructions for using the REPL.
Type
at the scala>
prompt to exit the REPL and return to the terminal prompt.
Congratulations! You have successfully installed Scala.
To install sbt, use brew once again:
To check the installation, run sbt
and you will see output that looks something like this: