Eclipse creates MAVEN management for Spark's Scala

Source: Internet
Author: User

Description, since Spark was written in Scala. Therefore, it is best to use Scala whether you are looking at the source code or writing spark-related codes. Then, as a programmer, the first thing to do is to sharpen the sword in hand. That's creating a code environment for writing Scala. Here because I am personally familiar with eclipse (although I think he is a bit off grade, practical tools, of course, it is best to choose their most familiar spicy). Okay, so what I want to do is create a MAVEN project in eclipse to manage the code of the Spark's Scala. In this process, several problems have been encountered:

1. How to install Scala's plugins in eclipse

The Scala plugin can be downloaded on Scala-ide's official website:, written in good, the corresponding IDE is often integrated with the latest version of Scala, if you are purely to write Scala code, there is no problem. But if you write code about spark, you may need to install scala-2.10.

You can actually download the corresponding Scala for Eclipse IDE directly.

2. How to write Scala code in MAVEN engineering

Often there is no scala-archetype-simple model when creating a MAVEN project, so you will need to manually add the custom catalog, adding the method as shown below:

Step: window-->preferences--->maven--->archetype the next action is as follows:



3, the last problem is the most important, because Spark is written in scala2.10.4, then you write about the spark code, of course, you must also use scala2.10.4

OK, now it's time to create Maven's Scala project, but there's a small problem because Spark is written in scala-2.10.x. So, when you create a MAVEN project to write the Scala code for Spark, you need to change the version of Scala in the corresponding pom.xml. As shown below:

Modify the version of the red section above to read as follows:

Save it. The environment you created for the development of Spark has been built. Let's play spark happily next.

Eclipse creates MAVEN management for Spark's Scala

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: 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.