SBT installs SBT under--mac in the Scala Eclipse environment

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.