In order for you to compile Scala-based spark Project with Eclipse, you need to install SBT
Environment: OS X Yosemite 10.10.3
1. Install Xcode
Because you want to install SBT in the terminal with MacPorts, and Xcode is the premise of macports installation, go to AppStore to download Xcode first and install its command line developer tools.
Installation is relatively simple, see: https://guide.macports.org/#installing
2. Installing MacPorts
Go to the official website to download its installation package and install it as simple as installing QQ
See: https://guide.macports.org/#installing
3. Install SBT
Enter the command below the terminal:
Port Install SBT
See a message similar to the following if the installation is finished:
... A lot of logs are omitted here ...
Downloading Https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/apply-macro/0.13.7/jars/apply-macro.jar ... [Successful] Org.scala-sbt#apply-macro;0.13.7!apply-macro.jar (9005MS):: Retrieving:: Org.scala-sbt#boot-app CONFS: [Default] Wuyi artifacts copied, 0 already retrieved (15709kb/378ms) Getting Scala 2.10.4 (for SBT) ... downloading Https://repo1.maven.org/maven2/org/scala-lang/jline/2.10.4/jline-2.10.4.jar ... [Successful] Org.scala-lang#jline;2.10.4!jline.jar (1589MS):: Retrieving:: Org.scala-sbt#boot-scala Confs: [ Default] 5 artifacts copied, 0 already retrieved (24459kb/195ms) [INFO] Set current project to Hello (in Build file:/us ers/apple/desktop/hello/)
4. Run a Hello World
To verify that SBT is not installed successfully, let's run a Hello World and try
$ mkdir hello$ CD hello$ echo ' object Hi {def main (args:array[string]) = println ("hi!")} ' > hw.scala$ sbt...> Run
[INFO] Updating {File:/users/apple/desktop/hello/}hello ...
[INFO] Resolving org.fusesource.jansi#jansi;1.4 ...
[INFO] Done updating.
[INFO] Compiling 1 Scala Source to/users/apple/desktop/hello/target/scala-2.10/classes ...
[INFO] Running Hi
Hi!
[Success] Total Time:4 S, completed Jul 8, 11:17:46 AM
This is an example of the official website, according to his do and appear the same result is right!
This is the end of the installation of SBT under Mac.
SBT installs SBT under--mac in the Scala Eclipse environment