Configuring the Maven+eclipse+spark development environment on your Mac

Source: Internet
Author: User
Tags aliyun

1. Installing the JDK

2, download scala-ide. Official website: http://scala-ide.org

3. Install Maven

4. In eclipse, configure MAVEN to install the path. Preference Settings--->maven--->installpath

5. Modify Maven's image file, that is, mirror in Setting.txt. The specific changes are as follows:

<mirrors> <mirror> <id>alimaven</id> <name>aliyun maven</name> <u Rl>http://maven.aliyun.com/nexus/content/groups/public/</url><mirrorOf>central</mirrorOf> </mirror> <!--Mirror|specifies a repository mirror site to use instead of a given repository. The repository that| ThisMirror serves has a ID that matches the mirrorof element of ThisMirror. IDs is used| forinheritance and direct lookup purposes, and must be unique across the set of mirrors. | <mirror> <id>mirrorId</id> <mirrorOf>repositoryId</mirrorOf> <name>huma N Readable Name for  ThisMirror.</name> <url>http://my.repository.com/repo/path</url></mirror> </mirrors>

6. Modify the contents of the Pom.xml file:

(1) Need to modify the Scala version

(2) Need to add spark dependency package

At this point, the save will download the corresponding jar package from the image set above. If the image is not set, because some of the foreign packages need FQ, and each modification need to record a long time. Causes an inability to run or fails to run.

7, modify the corresponding Scala compiler version of the project properties.

By this basically the configuration has ended, if by execution: MVN clean package, and then through Spark-submit submit run, should not be wrong. However, the local operation, or will be error, the specific errors are as follows:

caused By:java.lang.UnsatisfiedLinkError:no Snappyjava in Java.library.path

This error, through Google and Baidu, find a post to solve this approach: the corresponding URL: http://blog.csdn.net/stark_summer/article/details/47361603

In layman's words, the solution is:

8, solve the problem of 7.

(1) Enter the directory of Maven download source:

cd/users/jeffery/.m2/repository/org/xerial/snappy/snappy-java/1.0.4.1

(2) Unzip the Snappy-java-1.0.4.1.jar file

Unzip Snappy-java-1.0.4.1.jar

(3) Entry directory: org/xerial/snappy/native/mac/x86_64/

CD org/xerial/snappy/native/mac/x86_64/

(4) Copying files:

CP Libsnappyjava.jnilib Libsnappyjava.dylib

(5) Return to the pre-decompression directory and compress

Back up first. CP snappy-java-1.0. 4. 1.jar snappy-java-1.0. 4. 1.jar.old

After compressing into a circle file name: Jar CF snappy-java-1.0. 4. 1.jar org

It's OK.

Configuring the Maven+eclipse+spark development environment on Mac

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.