Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting a Scala interpreter to work

I'm very new to Scala. I have downloaded it, got it working in Eclipse where I'll be developing it; but I can't make it work in Terminal.

All sites and books say to just type scala - this doesn't work.

The website infuriatingly says:

We assume that both the Scala software and the user environment are set up correctly.

How do I do that bit?

I'm very new to this, and using Jargon or assuming too much knowledge of frameworks around Scala will ruin a good response; please keep it simple.

  • Mac OS X (10.6.7)
  • Scala: 2.9.0.1

Thank you

like image 582
Alex Avatar asked Jun 03 '11 17:06

Alex


People also ask

How do I use scala interpreter?

To run Scala from the command-line, download the binaries and unpack the archive. Start the Scala interpreter (aka the “REPL”) by launching scala from where it was unarchived. Start the Scala compiler by launching scalac from where it was unarchived.

How do I launch a scala REPL?

We can start Scala REPL by typing scala command in console/terminal.


1 Answers

For OS X, I highly recommend Homebrew.

The installation of Homebrew is incredibly easy. Once installed, you just need to run brew install scala and scala will be installed and ready to go. Homebrew also has tons of other goodies just a brew install away.

If you don't already have Java installed, you can install that with brew cask install java.

MacPorts or Fink may have something similar, but I prefer Homebrew.

like image 155
leedm777 Avatar answered Sep 29 '22 23:09

leedm777