Let’s see how to Install Scala Plugin in IntelliJ IDEA IDE tool and run the Spark Hello world example in Scala, IntelliJ IDE provides developers with editing and debugging support
By Nick Cotes
Let’s see how to Install Scala Plugin in IntelliJ IDEA IDE tool and run the Spark Hello world example in Scala, IntelliJ IDE provides developers with editing and debugging support for Scala applications. IntelliJ IDEA is the most used IDE for Scala due to its early adaptation and good scala code competition.
IntelliJ IDE by default doesn’t come with a Scala plugin hence you need to install explicitly from settings.
If you already have IntelliJ IDE setup and wanted to just install the Scala plugin jump to the next section. In case if you wanted to install IntelliJ, follow the below steps.
The archetype is a kind of templates that creates the right directory structure and downloads the required default dependencies. Since we have selected Scala archetypes, it downloads all Scala dependencies and enables IntelliJ to write Scala code.
5. In the next window, enter the project name. I am naming my project as scala-hello-world-example.
6. On next screen, review the options for artifact-id and group-id
7. Select Finish.
You will see the project created on IntelliJ and shows the project structure on left Project panel.
4. Setup Scala SDK
Now install Scala SDK, if you already have downloaded Scala you can point it to the local filesystem or you can download the Scala libraries from the IntelliJ itself.
IntelliJ will prompt you as shown below to Setup Scala SDK.
2. Select Setup Scala SDK, it prompts you the below window,
3. Select the create option.
4. From the next window select the Download option and
5. Choose the Scala version 2.12.12 (latest at the time of writing this article)
6. Make changes to pom.xml file
Now, we need to make some changes in the pom.xml file, you can either follow the below instructions or download the pom.xml file GitHub project and replace into your pom.xml file.
First, change the Scala version to the latest version, I am using 2.12.12