

{"id":958,"date":"2016-08-08T15:10:37","date_gmt":"2016-08-08T15:10:37","guid":{"rendered":"http:\/\/data-flair.training\/blogs\/?p=958"},"modified":"2019-03-12T14:43:04","modified_gmt":"2019-03-12T09:13:04","slug":"create-spark-scala-project","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/create-spark-scala-project\/","title":{"rendered":"Create Spark Project in Scala With Eclipse Without Maven"},"content":{"rendered":"<div class='__iawmlf-post-loop-links' style='display:none;' data-iawmlf-post-links='[{&quot;id&quot;:2457,&quot;href&quot;:&quot;http:\\\/\\\/scala-ide.org&quot;,&quot;archived_href&quot;:&quot;http:\\\/\\\/web-wp.archive.org\\\/web\\\/20241012160838\\\/http:\\\/\\\/scala-ide.org\\\/&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2025-12-11 06:35:25&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2025-12-17 18:46:58&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2025-12-22 16:58:19&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2025-12-28 06:12:08&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-02 07:16:16&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-05 21:07:38&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-09 04:22:41&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-17 20:16:21&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-21 09:10:27&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-26 23:43:57&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-30 07:59:07&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-06 00:36:01&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-02-10 13:21:06&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-14 16:53:32&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-20 05:06:07&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-03-02 12:27:54&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-10 16:42:43&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-14 14:58:26&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-19 17:39:37&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-01 10:31:35&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-10 14:22:09&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-04-14 06:50:48&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-18 21:49:25&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-22 16:20:38&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-04 19:02:35&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-11 14:03:53&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-15 05:55:19&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-20 16:04:41&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-24 18:06:04&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-06-01 18:45:11&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-06-08 14:25:42&quot;,&quot;http_code&quot;:503}],&quot;broken&quot;:false,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-06-08 14:25:42&quot;,&quot;http_code&quot;:503},&quot;process&quot;:&quot;done&quot;}]'><\/div>\n<h2>1. Objective &#8211; Spark Scala Project<\/h2>\n<p>This step by step tutorial will explain how to create a Spark project in Scala with Eclipse without Maven and how to submit the\u00a0application after the creation of jar.\u00a0This Guide also\u00a0briefs about the installation of <strong><a href=\"http:\/\/data-flair.training\/blogs\/why-you-should-learn-scala-introductory-tutorial\/\">Scala<\/a> <\/strong>plugin in eclipse and setup spark environment in eclipse. Learn how to configure development environment for developing Spark applications in Scala in this tutorial.<br \/>\nIf you are completely new to Apache Spark, I recommend you to read this <strong><a href=\"http:\/\/data-flair.training\/blogs\/apache-spark-tutorial\/\">Apache Spark Introduction Guide.<\/a><\/strong><\/p>\n<div id=\"attachment_995\" style=\"width: 1210px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/Create-First-Spark-Project-in-Scala-in-Eclipse-Tutorial-DataFlair.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-995\" class=\"wp-image-995 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/Create-First-Spark-Project-in-Scala-in-Eclipse-Tutorial-DataFlair.jpg\" alt=\"Create First Spark Project in Scala in Eclipse Tutorial \" width=\"1200\" height=\"630\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/Create-First-Spark-Project-in-Scala-in-Eclipse-Tutorial-DataFlair.jpg 1200w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/Create-First-Spark-Project-in-Scala-in-Eclipse-Tutorial-DataFlair-150x79.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/Create-First-Spark-Project-in-Scala-in-Eclipse-Tutorial-DataFlair-300x158.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/Create-First-Spark-Project-in-Scala-in-Eclipse-Tutorial-DataFlair-768x403.jpg 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/Create-First-Spark-Project-in-Scala-in-Eclipse-Tutorial-DataFlair-1024x538.jpg 1024w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/a><p id=\"caption-attachment-995\" class=\"wp-caption-text\">Create Spark project in Scala with Eclipse without Maven<\/p><\/div>\n<h2>2. Steps to Create\u00a0the Spark Project in Scala<\/h2>\n<p>To create Spark Project in Scala with Eclipse without Maven follow the steps given below-<\/p>\n<h3>i. Platform Used \/ Required<\/h3>\n<ul>\n<li><strong>Operating System:<\/strong> Windows \/ Linux \/ Mac<\/li>\n<li><strong>Java:<\/strong> Oracle Java 7<\/li>\n<li><strong>Scala:<\/strong> 2.11<\/li>\n<li><strong>Eclipse:<\/strong> Eclipse Luna, Mars or later<\/li>\n<\/ul>\n<h3>ii. Install Eclipse plugin for Scala<\/h3>\n<p>Open Eclipse Marketplace (<strong>Help &gt;&gt; Eclipse Marketplace<\/strong>) and search for &#8220;scala ide&#8221;. Now install\u00a0the Scala IDE. Alternatively, you can download <a href=\"http:\/\/scala-ide.org\/\" target=\"_blank\" rel=\"noopener noreferrer\">Eclipse for Scala<\/a>.<\/p>\n<div id=\"attachment_970\" style=\"width: 576px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/install-scala-eclipse-plugin.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-970\" class=\"wp-image-970 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/install-scala-eclipse-plugin.png\" alt=\"install scala eclipse plugin\" width=\"566\" height=\"597\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/install-scala-eclipse-plugin.png 566w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/install-scala-eclipse-plugin-142x150.png 142w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/install-scala-eclipse-plugin-284x300.png 284w\" sizes=\"auto, (max-width: 566px) 100vw, 566px\" \/><\/a><p id=\"caption-attachment-970\" class=\"wp-caption-text\">Install Eclipse plugin for Scala<\/p><\/div>\n<h3>iii. Create a New Spark Scala Project<\/h3>\n<p>To create a new Spark Scala project,\u00a0click on <strong>File &gt;&gt; New &gt;&gt; Other<\/strong><\/p>\n<div id=\"attachment_965\" style=\"width: 1376px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/create-new-spark-project-eclipse.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-965\" class=\"wp-image-965 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/create-new-spark-project-eclipse.png\" alt=\"create new spark project eclipse\" width=\"1366\" height=\"768\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/create-new-spark-project-eclipse.png 1366w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/create-new-spark-project-eclipse-150x84.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/create-new-spark-project-eclipse-300x169.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/create-new-spark-project-eclipse-768x432.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/create-new-spark-project-eclipse-1024x576.png 1024w\" sizes=\"auto, (max-width: 1366px) 100vw, 1366px\" \/><\/a><p id=\"caption-attachment-965\" class=\"wp-caption-text\">Create a New Spark Scala Project<\/p><\/div>\n<p>Select Scala Project:<\/p>\n<div id=\"attachment_975\" style=\"width: 535px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/select-scala-project.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-975\" class=\"wp-image-975 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/select-scala-project.png\" alt=\"select scala project\" width=\"525\" height=\"500\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/select-scala-project.png 525w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/select-scala-project-150x143.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/select-scala-project-300x286.png 300w\" sizes=\"auto, (max-width: 525px) 100vw, 525px\" \/><\/a><p id=\"caption-attachment-975\" class=\"wp-caption-text\">Select Scala Project<\/p><\/div>\n<p>Supply Project Name:<\/p>\n<div id=\"attachment_984\" style=\"width: 543px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/supply-project-name-spark-scala.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-984\" class=\"wp-image-984 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/supply-project-name-spark-scala.png\" alt=\"supply project name spark scala\" width=\"533\" height=\"717\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/supply-project-name-spark-scala.png 533w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/supply-project-name-spark-scala-112x150.png 112w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/supply-project-name-spark-scala-223x300.png 223w\" sizes=\"auto, (max-width: 533px) 100vw, 533px\" \/><\/a><p id=\"caption-attachment-984\" class=\"wp-caption-text\">Supply Project Name<\/p><\/div>\n<h3>iv. Create New Package<\/h3>\n<p>After creating the project, now create a new package.<\/p>\n<div id=\"attachment_963\" style=\"width: 1376px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/create-new-package-spark-scala.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-963\" class=\"wp-image-963 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/create-new-package-spark-scala.png\" alt=\"create new package spark scala\" width=\"1366\" height=\"768\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/create-new-package-spark-scala.png 1366w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/create-new-package-spark-scala-150x84.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/create-new-package-spark-scala-300x169.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/create-new-package-spark-scala-768x432.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/create-new-package-spark-scala-1024x576.png 1024w\" sizes=\"auto, (max-width: 1366px) 100vw, 1366px\" \/><\/a><p id=\"caption-attachment-963\" class=\"wp-caption-text\">Create New Package<\/p><\/div>\n<p>Supply Package Name:<\/p>\n<div id=\"attachment_983\" style=\"width: 535px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/supply-package-name-spark-scala.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-983\" class=\"wp-image-983 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/supply-package-name-spark-scala.png\" alt=\"supply package name spark scala\" width=\"525\" height=\"500\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/supply-package-name-spark-scala.png 525w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/supply-package-name-spark-scala-150x143.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/supply-package-name-spark-scala-300x286.png 300w\" sizes=\"auto, (max-width: 525px) 100vw, 525px\" \/><\/a><p id=\"caption-attachment-983\" class=\"wp-caption-text\">Supply Package Name<\/p><\/div>\n<h3>v. Create a New Scala Object<\/h3>\n<p>Now create a new Scala Object to develop Scala program for Spark application<\/p>\n<div id=\"attachment_964\" style=\"width: 1376px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/create-new-scala-object-spark.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-964\" class=\"wp-image-964 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/create-new-scala-object-spark.png\" alt=\"Create a new Scala Object to develop Scala program for Spark application\" width=\"1366\" height=\"768\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/create-new-scala-object-spark.png 1366w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/create-new-scala-object-spark-150x84.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/create-new-scala-object-spark-300x169.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/create-new-scala-object-spark-768x432.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/create-new-scala-object-spark-1024x576.png 1024w\" sizes=\"auto, (max-width: 1366px) 100vw, 1366px\" \/><\/a><p id=\"caption-attachment-964\" class=\"wp-caption-text\">Create a new Scala Object to develop Scala program for Spark application<\/p><\/div>\n<p>Select Scala Object:<\/p>\n<div id=\"attachment_974\" style=\"width: 535px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/select-scala-object.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-974\" class=\"wp-image-974 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/select-scala-object.png\" alt=\"Select Scala Object\" width=\"525\" height=\"500\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/select-scala-object.png 525w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/select-scala-object-150x143.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/select-scala-object-300x286.png 300w\" sizes=\"auto, (max-width: 525px) 100vw, 525px\" \/><\/a><p id=\"caption-attachment-974\" class=\"wp-caption-text\">Select Scala Object<\/p><\/div>\n<p>Supply Object Name:<\/p>\n<div id=\"attachment_985\" style=\"width: 535px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/supply-scala-object-name.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-985\" class=\"wp-image-985 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/supply-scala-object-name.png\" alt=\"Supply Object Name:\" width=\"525\" height=\"500\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/supply-scala-object-name.png 525w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/supply-scala-object-name-150x143.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/supply-scala-object-name-300x286.png 300w\" sizes=\"auto, (max-width: 525px) 100vw, 525px\" \/><\/a><p id=\"caption-attachment-985\" class=\"wp-caption-text\">Supply Object Name:<\/p><\/div>\n<h3>vi. New Scala Object in Editor<\/h3>\n<p>Scala object is ready\u00a0now we can develop our Spark wordcount code in Scala-<\/p>\n<div id=\"attachment_972\" style=\"width: 1376px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/new-scala-object.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-972\" class=\"wp-image-972 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/new-scala-object.png\" alt=\"new scala object\" width=\"1366\" height=\"768\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/new-scala-object.png 1366w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/new-scala-object-150x84.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/new-scala-object-300x169.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/new-scala-object-768x432.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/new-scala-object-1024x576.png 1024w\" sizes=\"auto, (max-width: 1366px) 100vw, 1366px\" \/><\/a><p id=\"caption-attachment-972\" class=\"wp-caption-text\">New Scala Object in Editor to create Spark Application<\/p><\/div>\n<h3>vii. Copy below Spark Scala Wordcount\u00a0Code in Editor<\/h3>\n<p>[php]<br \/>\npackage com.dataflair.spark<br \/>\nimport org.apache.spark.SparkContext<br \/>\nimport org.apache.spark.SparkConf<br \/>\nobject Wordcount {<br \/>\ndef main(args: Array[String]) {<br \/>\n\/\/Create conf object<br \/>\nval conf = new SparkConf()<br \/>\n.setAppName(&#8220;WordCount&#8221;)<br \/>\n\/\/create spark context object<br \/>\nval sc = new SparkContext(conf)<br \/>\n\/\/Check whether sufficient params are supplied<br \/>\nif (args.length &lt; 2) {<br \/>\nprintln(&#8220;Usage: ScalaWordCount &lt;input&gt; &lt;output&gt;&#8221;)<br \/>\nSystem.exit(1)<br \/>\n}<br \/>\n\/\/Read file and create RDD<br \/>\nval rawData = sc.textFile(args(0))<br \/>\n\/\/convert the lines into words using flatMap operation<br \/>\nval words = rawData.flatMap(line =&gt; line.split(&#8221; &#8220;))<br \/>\n\/\/count the individual words using map and reduceByKey operation<br \/>\nval wordCount = words.map(word =&gt; (word, 1)).reduceByKey(_ + _)<br \/>\n\/\/Save the result<br \/>\nwordCount.saveAsTextFile(args(1))<br \/>\n\/\/stop the spark context<br \/>\nsc.stop<br \/>\n}<br \/>\n}[\/php]<\/p>\n<div id=\"attachment_967\" style=\"width: 1376px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/develop-spark-scala-code.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-967\" class=\"wp-image-967 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/develop-spark-scala-code.png\" alt=\"develop sparkscala code\" width=\"1366\" height=\"768\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/develop-spark-scala-code.png 1366w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/develop-spark-scala-code-150x84.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/develop-spark-scala-code-300x169.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/develop-spark-scala-code-768x432.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/develop-spark-scala-code-1024x576.png 1024w\" sizes=\"auto, (max-width: 1366px) 100vw, 1366px\" \/><\/a><p id=\"caption-attachment-967\" class=\"wp-caption-text\">Spark Scala WordCount Code in Editor<\/p><\/div>\n<p><em>You will see lots of error due to missing libraries.<\/em><\/p>\n<h3>viii. Add Spark Libraries<\/h3>\n<p>Configure Spark environment in Eclipse: Right click on project name &gt;&gt; build path &gt;&gt; Configure Build Path<\/p>\n<div id=\"attachment_961\" style=\"width: 1376px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/add-spark-library-scala-project.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-961\" class=\"wp-image-961 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/add-spark-library-scala-project.png\" alt=\"add spark library scala project\" width=\"1366\" height=\"768\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/add-spark-library-scala-project.png 1366w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/add-spark-library-scala-project-150x84.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/add-spark-library-scala-project-300x169.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/add-spark-library-scala-project-768x432.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/add-spark-library-scala-project-1024x576.png 1024w\" sizes=\"auto, (max-width: 1366px) 100vw, 1366px\" \/><\/a><p id=\"caption-attachment-961\" class=\"wp-caption-text\">Configure Spark environment in Eclipse<\/p><\/div>\n<p>Add the External Jars:<\/p>\n<div id=\"attachment_971\" style=\"width: 742px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/library-add-external-jars.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-971\" class=\"wp-image-971 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/library-add-external-jars.png\" alt=\"library add external jars\" width=\"732\" height=\"555\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/library-add-external-jars.png 732w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/library-add-external-jars-150x114.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/library-add-external-jars-300x227.png 300w\" sizes=\"auto, (max-width: 732px) 100vw, 732px\" \/><\/a><p id=\"caption-attachment-971\" class=\"wp-caption-text\">Add the External Jars<\/p><\/div>\n<h3>ix. Select Spark Jars and insert<\/h3>\n<p>You should have spark setup available in developing environment,\u00a0it will be needed for spark libraries.<\/p>\n<div id=\"attachment_976\" style=\"width: 1376px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/select-spark-jars.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-976\" class=\"wp-image-976 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/select-spark-jars.png\" alt=\"select spark jars\" width=\"1366\" height=\"768\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/select-spark-jars.png 1366w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/select-spark-jars-150x84.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/select-spark-jars-300x169.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/select-spark-jars-768x432.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/select-spark-jars-1024x576.png 1024w\" sizes=\"auto, (max-width: 1366px) 100vw, 1366px\" \/><\/a><p id=\"caption-attachment-976\" class=\"wp-caption-text\">Select Spark Jars and insert<\/p><\/div>\n<p>Go to &#8220;<strong>Spark-Home &gt;&gt; jars<\/strong>&#8221; and select all the jars:<\/p>\n<div id=\"attachment_978\" style=\"width: 1376px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/select-spark-jars-select.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-978\" class=\"wp-image-978 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/select-spark-jars-select.png\" alt=\"select spark jars select\" width=\"1366\" height=\"768\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/select-spark-jars-select.png 1366w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/select-spark-jars-select-150x84.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/select-spark-jars-select-300x169.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/select-spark-jars-select-768x432.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/select-spark-jars-select-1024x576.png 1024w\" sizes=\"auto, (max-width: 1366px) 100vw, 1366px\" \/><\/a><p id=\"caption-attachment-978\" class=\"wp-caption-text\">select all the jars<\/p><\/div>\n<p>Import the selected jar:<\/p>\n<div id=\"attachment_977\" style=\"width: 1376px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/select-spark-jars-add-build-path.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-977\" class=\"wp-image-977 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/select-spark-jars-add-build-path.png\" alt=\"select spark jars add build path\" width=\"1366\" height=\"768\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/select-spark-jars-add-build-path.png 1366w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/select-spark-jars-add-build-path-150x84.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/select-spark-jars-add-build-path-300x169.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/select-spark-jars-add-build-path-768x432.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/select-spark-jars-add-build-path-1024x576.png 1024w\" sizes=\"auto, (max-width: 1366px) 100vw, 1366px\" \/><\/a><p id=\"caption-attachment-977\" class=\"wp-caption-text\">Import the selected jar<\/p><\/div>\n<h3>x. Spark Scala Word Count Program<\/h3>\n<p>After importing the libraries all the errors will be removed.<\/p>\n<div id=\"attachment_988\" style=\"width: 1376px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/wordcount-program-spark-scala.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-988\" class=\"wp-image-988 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/wordcount-program-spark-scala.png\" alt=\"wordcount program spark scala\" width=\"1366\" height=\"768\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/wordcount-program-spark-scala.png 1366w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/wordcount-program-spark-scala-150x84.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/wordcount-program-spark-scala-300x169.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/wordcount-program-spark-scala-768x432.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/wordcount-program-spark-scala-1024x576.png 1024w\" sizes=\"auto, (max-width: 1366px) 100vw, 1366px\" \/><\/a><p id=\"caption-attachment-988\" class=\"wp-caption-text\">Spark WordCount Program in Scala<\/p><\/div>\n<p>We have successfully\u00a0created Spark environment in Eclipse and developed Spark Scala program. Now let&#8217;s deploy the Spark job\u00a0on <a href=\"http:\/\/data-flair.training\/blogs\/frequent-linux-commands-beginners-tutorial\/\">Linux<\/a>, before deploying\/running the application you must have Spark Installed.<br \/>\nFollow this links to<a href=\"http:\/\/data-flair.training\/blogs\/apache-spark-installation-in-standalone-mode\/\"> install Apache Spark on single node cluster<\/a>\u00a0or on the <a href=\"http:\/\/data-flair.training\/blogs\/apache-spark-installation-on-multi-node-cluster-step-by-step-guide\/\">multi-node cluster.<\/a><\/p>\n<h3>xi. Create the Spark Scala Program Jar File<\/h3>\n<p>Before running created <strong>Spark word count application<\/strong> we have to create a jar file. Right click on <strong>project &gt;&gt; export<\/strong><\/p>\n<div id=\"attachment_969\" style=\"width: 1376px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/export-project-spark-scala.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-969\" class=\"wp-image-969 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/export-project-spark-scala.png\" alt=\"export project spark scala\" width=\"1366\" height=\"768\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/export-project-spark-scala.png 1366w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/export-project-spark-scala-150x84.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/export-project-spark-scala-300x169.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/export-project-spark-scala-768x432.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/export-project-spark-scala-1024x576.png 1024w\" sizes=\"auto, (max-width: 1366px) 100vw, 1366px\" \/><\/a><p id=\"caption-attachment-969\" class=\"wp-caption-text\">Create the Spark Scala Program Jar File<\/p><\/div>\n<p>Select Jar-file Option to Export:<\/p>\n<div id=\"attachment_973\" style=\"width: 535px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/select-jar-file-to-export.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-973\" class=\"wp-image-973 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/select-jar-file-to-export.png\" alt=\"Select Jar-file Option to Export\" width=\"525\" height=\"550\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/select-jar-file-to-export.png 525w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/select-jar-file-to-export-143x150.png 143w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/select-jar-file-to-export-286x300.png 286w\" sizes=\"auto, (max-width: 525px) 100vw, 525px\" \/><\/a><p id=\"caption-attachment-973\" class=\"wp-caption-text\">Select Jar-file Option to Export<\/p><\/div>\n<p>Create the Jar file:<\/p>\n<div id=\"attachment_966\" style=\"width: 573px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/create-spark-wordcount-jar-scala.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-966\" class=\"wp-image-966 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/create-spark-wordcount-jar-scala.png\" alt=\"create spark wordcoun jar scala\" width=\"563\" height=\"667\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/create-spark-wordcount-jar-scala.png 563w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/create-spark-wordcount-jar-scala-127x150.png 127w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/create-spark-wordcount-jar-scala-253x300.png 253w\" sizes=\"auto, (max-width: 563px) 100vw, 563px\" \/><\/a><p id=\"caption-attachment-966\" class=\"wp-caption-text\">Create the Jar file<\/p><\/div>\n<p>The jar file for the Spark Scala application has been created, now we need to run it.<\/p>\n<h3>xii. Go to Spark Home Directory<\/h3>\n<p>Login to <a href=\"http:\/\/data-flair.training\/blogs\/frequently-used-important-linux-commands-tutorial\/\">Linux<\/a> and open terminal.\u00a0To run Spark Scala application we will be using Ubuntu Linux. Copy the jar file to Ubuntu and create one text file, which we will use as input for Spark Scala wordcount job.<\/p>\n<div id=\"attachment_962\" style=\"width: 1376px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/cd-spark-home-directory.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-962\" class=\"wp-image-962 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/cd-spark-home-directory.png\" alt=\"cd spark home directory\" width=\"1366\" height=\"768\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/cd-spark-home-directory.png 1366w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/cd-spark-home-directory-150x84.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/cd-spark-home-directory-300x169.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/cd-spark-home-directory-768x432.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/cd-spark-home-directory-1024x576.png 1024w\" sizes=\"auto, (max-width: 1366px) 100vw, 1366px\" \/><\/a><p id=\"caption-attachment-962\" class=\"wp-caption-text\">cd spark home directory<\/p><\/div>\n<h3>xiii. Submit Spark Application using spark-submit script<\/h3>\n<p>To submit the Spark application using below command:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">bin\/spark-submit --class &lt;Qualified-Class-Name&gt; --master &lt;Master&gt; &lt;Path-Of-Jar-File&gt; &lt;Input-Path&gt; &lt;Output-Path&gt;<\/pre>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">bin\/spark-submit --class com.dataflair.spark.Wordcount --master local ..\/sparkJob.jar ..\/wc-data output<\/pre>\n<p>Let&#8217;s understand above command:<\/p>\n<ul>\n<li><strong>bin\/spark-submit:<\/strong> To submit Spark Application<\/li>\n<li><strong>&#8211;class:<\/strong> To specify the class name to execute<\/li>\n<li><strong>&#8211;master:<\/strong> Master (local \/ &lt;Spark-URI&gt; \/ yarn)<\/li>\n<li><strong>&lt;Jar-Path&gt;:<\/strong> The jar file of application<\/li>\n<li><strong>&lt;Input-Path&gt;:<\/strong> Location from where input data will be read<\/li>\n<li><strong>&lt;Output-Path&gt;:<\/strong> Location where Spark application will write output<\/li>\n<\/ul>\n<div id=\"attachment_979\" style=\"width: 1376px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/spark-scala-jar-submit-run-command.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-979\" class=\"wp-image-979 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/spark-scala-jar-submit-run-command.png\" alt=\"Submit Spark Application using spark-submit script\" width=\"1366\" height=\"768\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/spark-scala-jar-submit-run-command.png 1366w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/spark-scala-jar-submit-run-command-150x84.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/spark-scala-jar-submit-run-command-300x169.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/spark-scala-jar-submit-run-command-768x432.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/spark-scala-jar-submit-run-command-1024x576.png 1024w\" sizes=\"auto, (max-width: 1366px) 100vw, 1366px\" \/><\/a><p id=\"caption-attachment-979\" class=\"wp-caption-text\">Submit Spark Application using spark-submit script<\/p><\/div>\n<div id=\"attachment_980\" style=\"width: 1376px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/spark-wordcount-job-run.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-980\" class=\"wp-image-980 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/spark-wordcount-job-run.png\" alt=\"spark wordcount job run\" width=\"1366\" height=\"768\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/spark-wordcount-job-run.png 1366w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/spark-wordcount-job-run-150x84.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/spark-wordcount-job-run-300x169.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/spark-wordcount-job-run-768x432.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/spark-wordcount-job-run-1024x576.png 1024w\" sizes=\"auto, (max-width: 1366px) 100vw, 1366px\" \/><\/a><p id=\"caption-attachment-980\" class=\"wp-caption-text\">Submit Spark Application using spark-submit script<\/p><\/div>\n<p><em>The application has been completed successfully, now browse the result.<\/em><\/p>\n<h3>xiv. Browse the result<\/h3>\n<p>Browse the\u00a0output directory and open the file with name part-xxxxx which contains the output of the application.<\/p>\n<div id=\"attachment_982\" style=\"width: 1376px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/spark-wordcount-job-success.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-982\" class=\"wp-image-982 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/spark-wordcount-job-success.png\" alt=\"spark wordcount job success\" width=\"1366\" height=\"768\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/spark-wordcount-job-success.png 1366w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/spark-wordcount-job-success-150x84.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/spark-wordcount-job-success-300x169.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/spark-wordcount-job-success-768x432.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/spark-wordcount-job-success-1024x576.png 1024w\" sizes=\"auto, (max-width: 1366px) 100vw, 1366px\" \/><\/a><p id=\"caption-attachment-982\" class=\"wp-caption-text\">spark wordcount job success<\/p><\/div>\n<p>We have successfully created Spark project in Scala and deployed on Ubuntu.<br \/>\nTo play with Spark First learn <strong><a href=\"http:\/\/data-flair.training\/blogs\/apache-spark-rdd-tutorial\/\">RDD<\/a><\/strong>,<strong><a href=\"http:\/\/data-flair.training\/blogs\/apache-spark-sql-dataframe-tutorial\/\"> DataFrame<\/a><\/strong>, <strong><a href=\"http:\/\/data-flair.training\/blogs\/apache-spark-dataset-tutorial\/\">DataSet in Apache Spark<\/a> <\/strong>and then refer this <strong><a href=\"http:\/\/data-flair.training\/blogs\/apache-spark-shell-commands-beginners-tutorial\/\">Spark shell commands tutorial<\/a><\/strong> to practically implements Spark functionalities.<br \/>\n<strong>See Also-<\/strong><\/p>\n<ul>\n<li><a href=\"http:\/\/data-flair.training\/blogs\/rdd-transformations-actions-apis-apache-spark\/\">Spark Transformation and Action APIs<\/a><\/li>\n<li><a href=\"http:\/\/data-flair.training\/blogs\/how-apache-spark-works-run-time-spark-architecture\/\">How does Apache Spark work?<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>1. Objective &#8211; Spark Scala Project This step by step tutorial will explain how to create a Spark project in Scala with Eclipse without Maven and how to submit the\u00a0application after the creation of&#46;&#46;&#46;<\/p>\n","protected":false},"author":6,"featured_media":34944,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[6796,11665,12438,13022,13056,16625,13112,13143],"class_list":["post-958","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-spark","tag-install-spark","tag-run-spark","tag-scala-eclipse","tag-spark-scala","tag-spark-eclipse","tag-spark-scala-project","tag-spark-scala-training","tag-spark-ubuntu"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Create Spark Project in Scala With Eclipse Without Maven - DataFlair<\/title>\n<meta name=\"description\" content=\"Spark Scala project tutorial - how to develop Spark project in Scala.Learn to setup Apache Spark in eclipse(Scala IDE) with Scala Spark word count Example.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/data-flair.training\/blogs\/create-spark-scala-project\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Create Spark Project in Scala With Eclipse Without Maven - DataFlair\" \/>\n<meta property=\"og:description\" content=\"Spark Scala project tutorial - how to develop Spark project in Scala.Learn to setup Apache Spark in eclipse(Scala IDE) with Scala Spark word count Example.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/create-spark-scala-project\/\" \/>\n<meta property=\"og:site_name\" content=\"DataFlair\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DataFlairWS\/\" \/>\n<meta property=\"article:published_time\" content=\"2016-08-08T15:10:37+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-03-12T09:13:04+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/Create-First-Spark-Project-in-Scala-in-Eclipse-Tutorial-DataFlair-1.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"DataFlair Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:site\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DataFlair Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Create Spark Project in Scala With Eclipse Without Maven - DataFlair","description":"Spark Scala project tutorial - how to develop Spark project in Scala.Learn to setup Apache Spark in eclipse(Scala IDE) with Scala Spark word count Example.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/data-flair.training\/blogs\/create-spark-scala-project\/","og_locale":"en_US","og_type":"article","og_title":"Create Spark Project in Scala With Eclipse Without Maven - DataFlair","og_description":"Spark Scala project tutorial - how to develop Spark project in Scala.Learn to setup Apache Spark in eclipse(Scala IDE) with Scala Spark word count Example.","og_url":"https:\/\/data-flair.training\/blogs\/create-spark-scala-project\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2016-08-08T15:10:37+00:00","article_modified_time":"2019-03-12T09:13:04+00:00","og_image":[{"width":1200,"height":630,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/Create-First-Spark-Project-in-Scala-in-Eclipse-Tutorial-DataFlair-1.jpg","type":"image\/jpeg"}],"author":"DataFlair Team","twitter_card":"summary_large_image","twitter_creator":"@DataFlairWS","twitter_site":"@DataFlairWS","twitter_misc":{"Written by":"DataFlair Team","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/create-spark-scala-project\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/create-spark-scala-project\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/2c58ecb4f73a39f0ef993f1ddfcd7b89"},"headline":"Create Spark Project in Scala With Eclipse Without Maven","datePublished":"2016-08-08T15:10:37+00:00","dateModified":"2019-03-12T09:13:04+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/create-spark-scala-project\/"},"wordCount":1076,"commentCount":47,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/create-spark-scala-project\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/Create-First-Spark-Project-in-Scala-in-Eclipse-Tutorial-DataFlair-1.jpg","keywords":["install spark","run spark","scala eclipse","spark &amp; Scala","spark eclipse","Spark Scala project","spark scala training","spark ubuntu"],"articleSection":["Apache Spark Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/create-spark-scala-project\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/create-spark-scala-project\/","url":"https:\/\/data-flair.training\/blogs\/create-spark-scala-project\/","name":"Create Spark Project in Scala With Eclipse Without Maven - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/create-spark-scala-project\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/create-spark-scala-project\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/Create-First-Spark-Project-in-Scala-in-Eclipse-Tutorial-DataFlair-1.jpg","datePublished":"2016-08-08T15:10:37+00:00","dateModified":"2019-03-12T09:13:04+00:00","description":"Spark Scala project tutorial - how to develop Spark project in Scala.Learn to setup Apache Spark in eclipse(Scala IDE) with Scala Spark word count Example.","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/create-spark-scala-project\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/create-spark-scala-project\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/create-spark-scala-project\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/Create-First-Spark-Project-in-Scala-in-Eclipse-Tutorial-DataFlair-1.jpg","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/Create-First-Spark-Project-in-Scala-in-Eclipse-Tutorial-DataFlair-1.jpg","width":1200,"height":630,"caption":"Create Spark project in Scala with Eclipse without Maven"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/create-spark-scala-project\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"Apache Spark Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/spark\/"},{"@type":"ListItem","position":3,"name":"Create Spark Project in Scala With Eclipse Without Maven"}]},{"@type":"WebSite","@id":"https:\/\/data-flair.training\/blogs\/#website","url":"https:\/\/data-flair.training\/blogs\/","name":"DataFlair","description":"Learn Today. Lead Tomorrow.","publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/data-flair.training\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/data-flair.training\/blogs\/#organization","name":"DataFlair","url":"https:\/\/data-flair.training\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","width":106,"height":48,"caption":"DataFlair"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataFlairWS\/","https:\/\/x.com\/DataFlairWS","https:\/\/www.linkedin.com\/company\/dataflair-web-services-pvt-ltd\/","https:\/\/www.youtube.com\/user\/DataFlairWS"]},{"@type":"Person","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/2c58ecb4f73a39f0ef993f1ddfcd7b89","name":"DataFlair Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/1ce4a0e3e542444fc73bbebf83e89e8b73e2d95ccb1fcee64da9945f078b97c5?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/1ce4a0e3e542444fc73bbebf83e89e8b73e2d95ccb1fcee64da9945f078b97c5?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/1ce4a0e3e542444fc73bbebf83e89e8b73e2d95ccb1fcee64da9945f078b97c5?s=96&d=mm&r=g","caption":"DataFlair Team"},"description":"The DataFlair Team provides industry-driven content on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. Our expert educators focus on delivering value-packed, easy-to-follow resources for tech enthusiasts and professionals.","url":"https:\/\/data-flair.training\/blogs\/author\/dfteam2\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/958","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=958"}],"version-history":[{"count":7,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/958\/revisions"}],"predecessor-version":[{"id":51995,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/958\/revisions\/51995"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/34944"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=958"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=958"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=958"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}