Installing Scala Language on MacBook : Manually (No Brew or Coursier)

481 Views Asked by At

I am trying to install scala language on my work laptop (mac). Could someone let me know the installation commands if I am unable to use brew or coursier? I have downloaded the package from github directly but unsure of next steps.

When using courier download as given on scala website I get this error: Checking if the standard Scala applications are installed: Exception in thread "main" coursier.error.ResolutionError$CantDownloadModule: Error downloading io.get-coursier:apps:latest.release

I have a feeling that my works security does not allow this installation. Is there a way around it / manual install for scala?

Homebrew I cannot download as I am not allowed to give out passwords during installation.

1

There are 1 best solutions below

0
On

You can try the command listed on their site for the Mac installation:

curl -fL https://github.com/coursier/launchers/raw/master/cs-x86_64-apple-darwin.gz | gzip -d > cs && chmod +x cs && (xattr -d com.apple.quarantine cs || true) && ./cs setup

This should do everything on its own.

However, if you have admin rights, I recommend installing it via brew. Using brew is the most popular and easiest way, and you will use brew a lot on the Mac:

brew update
brew install scala

If you are not allowed to have admin rights, go to your IT department and have them install Scala for you via the brew command.

If this is not possible, you can simply download the Scala binaries. For example, assuming you want Scala 2.13.10, just download and unzip the scala-2.13.10.tgz zip file at your desired location. After that, you will have to set up your PATH manually, to be able to use the scala command in the command line:

export PATH=”/Users/your_user/scala/bin:$PATH”

Here's a more detailed tutorial on this approach.