We are no longer accepting contributions to Documentation. Please see our post on meta.

Scala Language

Setting up Scala 2.10.1–2.11.8

2.10.1
2.10.2
2.10.3
2.11.5
2.10.4
2.11.0
2.11.1
2.11.2
2.11.4
2.10.5
2.11.6
2.11.7
2.10.6
2.11.8
2.12.0
2.12.1
2.11.11
2.12.2

This draft deletes the entire topic.

Examples

  • 1

    Download your preferred version from Lightbend with curl:

    curl -O http://downloads.lightbend.com/scala/2.xx.x/scala-2.xx.x.tgz
    

    Unzip the tar file to /usr/local/share or /opt/bin:

    unzip scala-2.xx.x.tgz 
    mv scala-2.xx.x /usr/local/share/scala
    

    Add the PATH to ~/.profile or ~/.bash_profile or ~/.bashrc by including this text to one of those files:

    $SCALA_HOME=/usr/local/share/scala
    export PATH=$SCALA_HOME/bin:$PATH
    

    To verify that it is installed correctly, in the terminal command prompt:

    which scala
    

    The response returned should be the equivalent to what you placed in your PATH variable. To verify that scala is working:

    scala
    

    This should start the Scala REPL, and report the version (which, in turn, should match the version you downloaded).

  • 0

    On Mac OSX computers with MacPorts installed, open a terminal window and type:

    port list | grep scala
    

    This will list all the Scala-related packages available. To install one (in this example the 2.11 version of Scala):

    sudo port install scala2.11
    

    (The 2.11 may change if you want to install a different version.)

    All dependencies will automatically be installed and your $PATH parameter updated. To verify everything worked:

    which scala
    

    This will show you the path to the Scala installation.

    scala
    

    This will open up the Scala REPL, and report the version number installed.

  • 0

    On Debian-based distributions, including Ubuntu, the most straightforward way is to use the .deb installation file. Go to the Scala website. Choose the version you want to install then scroll down and look for scala-x.x.x.deb.

    You can install the scala deb from command line:

    sudo dpkg -i scala-x.x.x.deb
    

    To verify that it is installed correctly, in the terminal command prompt:

    which scala
    

    The response returned should be the equivalent to what you placed in your PATH variable. To verify that scala is working:

    scala
    

    This should start the Scala REPL, and report the version (which, in turn, should match the version you downloaded).

Please consider making a request to improve this example.

Syntax

Syntax

Parameters

Parameters

Remarks

Remarks

Still have a question about Setting up Scala? Ask Question

Topic Outline


    We are no longer accepting contributions to Documentation. Drafts cannot be modified.