Sign up ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I'm trying to install Scala following the advice at the official website:

sudo port install scala

But this gives me:

--->  Fetching archive for scala
--->  Attempting to fetch scala-2.7.7_2.darwin_10.x86_64.tbz2 from
--->  Fetching scala
--->  Verifying checksum(s) for scala
--->  Extracting scala
--->  Configuring scala
Error: Please use one of the numbered scala* ports instead.
Error: Target org.macports.configure returned: obsolete port
Log for scala is at: /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_scala/scala/main.log
Error: Status 1 encountered during processing.
To report a bug, see <>

I'm completely new to both MacPorts and Scala, and don't know what "Please use one of the numbered scala* ports instead" means. What command should I use then?

I'm not too picky about the Scala version, but of course I'd prefer the latest stable one (currently 2.9.1).

NB: I know I could install Scala without MacPorts, but I'd rather use Macports to manage the installation if it's possible without much hassle.

share|improve this question
Update (2015), just for the record: nowadays I'd prefer Homebrew for installing Scala (and other things) on OS X: brew install scala – Jonik Nov 17 at 20:19

4 Answers 4

up vote 6 down vote accepted

Try installing Scala 2.9

sudo port install scala2.9

… or Scala 2.10

sudo port install scala2.10
share|improve this answer
Yep, that worked smoothly. Thanks! – Jonik Nov 1 '11 at 19:58

Now, scala29 is obsolete. You need to install scala 2.9 or scala2.10:

sudo port install scala2.9
share|improve this answer
Welcome to Ask Different! You can always improve existing posts by editing them. There's no need to post another answer for each new version or version change. – slhck Apr 28 '13 at 8:54

The first thing you need to do is find the latest available version of scala. It helps to have recently updated your macports tree:

sudo port selfupdate

Once that is done, grep for scala-related ports:

port list | grep scala

At the time of this writing, here is sample output from that:

$ port list | grep scala
scala-migrations               @1.0.1          java/scala-migrations
scala2.10                      @2.10.5         lang/scala2.10
scala2.10-docs                 @2.10.5         lang/scala2.10
scala2.11                      @2.11.7         lang/scala2.11
scala2.11-docs                 @2.11.7         lang/scala2.11
scala2.7                       @2.7.7          lang/scala2.7
scala2.8                       @2.8.2          lang/scala2.8
scala2.9                       @2.9.3          lang/scala2.9
scala210                       @  lang/scala210
scala27                        @2.7.7          lang/scala27
scala28                        @2.8.2          lang/scala28
scala29                        @2.9.2          lang/scala29
scalapack                      @2.0.2          math/scalapack
p5.8-scalar-list-utils         @1.410.0        perl/p5-graveyard
p5.10-scalar-list-utils        @1.410.0        perl/p5-graveyard
p5.12-scalar-list-utils        @1.410.0        perl/p5-graveyard
p5.14-scalar-list-utils        @1.410.0        perl/p5-graveyard
p5.8-set-scalar                @1.260.0        perl/p5-graveyard
p5.10-set-scalar               @1.260.0        perl/p5-graveyard
p5.12-set-scalar               @1.260.0        perl/p5-graveyard
p5.14-set-scalar               @1.260.0        perl/p5-graveyard
p5-scalar-list-utils           @1.420.0        perl/p5-scalar-list-utils
p5.16-scalar-list-utils        @1.420.0        perl/p5-scalar-list-utils
p5.18-scalar-list-utils        @1.420.0        perl/p5-scalar-list-utils
p5.20-scalar-list-utils        @1.420.0        perl/p5-scalar-list-utils
p5.22-scalar-list-utils        @1.420.0        perl/p5-scalar-list-utils
p5-scalar-string               @0.2.0          perl/p5-scalar-string
p5.16-scalar-string            @0.2.0          perl/p5-scalar-string
p5.18-scalar-string            @0.2.0          perl/p5-scalar-string
p5.20-scalar-string            @0.2.0          perl/p5-scalar-string
p5.22-scalar-string            @0.2.0          perl/p5-scalar-string
p5-set-scalar                  @1.290.0        perl/p5-set-scalar
p5.16-set-scalar               @1.290.0        perl/p5-set-scalar
p5.18-set-scalar               @1.290.0        perl/p5-set-scalar
p5.20-set-scalar               @1.290.0        perl/p5-set-scalar
p5.22-set-scalar               @1.290.0        perl/p5-set-scalar
scala_select                   @0.1            sysutils/scala_select

You want to look for the basic scala package with the latest (i.e. largest) version number. In this case scala2.11. You can also look here, but the list is a little harder to digest. Once you've selected your package, install it like so:

sudo port install scala2.11

After running this you can confirm it installed with this:

ls -la /opt/local/bin/ | grep scala

For instance:

$ ls -la /opt/local/bin/ | grep scala
lrwxr-xr-x   1 root admin     27 Nov 17 10:54 fsc-2.11 -> ../share/scala-2.11/bin/fsc
lrwxr-xr-x   1 root admin     29 Nov 17 10:54 scala-2.11 -> ../share/scala-2.11/bin/scala
lrwxr-xr-x   1 root admin     30 Nov 17 10:54 scalac-2.11 -> ../share/scala-2.11/bin/scalac
lrwxr-xr-x   1 root admin     32 Nov 17 10:54 scaladoc-2.11 -> ../share/scala-2.11/bin/scaladoc
lrwxr-xr-x   1 root admin     30 Nov 17 10:54 scalap-2.11 -> ../share/scala-2.11/bin/scalap

Now you're most of the way there. The last thing you want to do is select the current version of scala. Currently no version is selected and you can show this with the following command:

$ sudo port select --list scala
Available versions for scala:
    none (active)

This says that scala2.11 is installed but no version is selected. To select a version run this (though you want to substitute in the version you actually installed):

$ sudo port select --set scala scala2.11
Selecting 'scala2.11' for 'scala' succeeded. 'scala2.11' is now active.

And showing it's now selected:

$ sudo port select --list scala
Available versions for scala:
    scala2.11 (active)
$ which scala
share|improve this answer

Your project's SBT config file can be used to download the latest version of Scala -- for the project. Of course this uses a little extra time for each project you set up, compared to having the latest Scala version installed already. The advantage is that SBT's repositories are always up to date with Scala releases, unlike Macports.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.