Scala IDE: Scala Library error on a new project

Created my first project in Scala IDE and got this error on my project:

"Unable to find a scala library. Please add the scala container
or a scala library jar to the build path."

It seems that the project build path is missing the Scala system library. To fix:

– right-click project, click Properties

– click Java Build Path, then Libraries tab

– press Add Library button, select ‘Scala Library’ and then ok.

Done!

Scala notes: basic functions

A few notes for myself so I don’t forget:

A function like:

f(x) = x * x

is declared in Scala like:

def square(x : Int) = x * x

… which is a function called square, which takes a value x which is of type Int, and calculates the square of x.

Mac OS X: Adding to your PATH

If you install an app that runs from the shell and you want to add the path to the executable to your PATH env var, just add it to PATH in a .bash_profile file in your user’s home dir – this will be run every time you start a new terminal session:

export PATH=$PATH:your_path_here