Scala Programming using IntelliJ IDEA
Table of Contents
This article discusses reasons for switching to IntelliJ IDEA for writing Scala as an alternative to Eclipse. We also show how to do the setup. IntelliJ IDEA is a Java IDE from JetBrains, which supports Scala. IntelliJ’s youtube channel contains more material and guides for those who are interested.
Reasons to Use IntelliJ
Here are some reasons why I use IntelliJ.
- It’s easy and intuitive to learn for people of any skill level.
- It has a user-friendly and sophisticated interface.
- It has an option to choose a dark theme, such as Darcula, which is much more pleasant for the eyes, especially later in the evening.
- It uses Source Code Pro font by default, which is font designed for programming.
- It has powerful refactoring and static code analysis tools.
- It is intended to be used with the keyboard and doesn’t require a lot of mouse movement.
Setting Up IntelliJ IDEA
- Request for a student license. With a student license, you can get the professional versions of JetBrains products for free.
- Download IntelliJ IDEA. If you applied for a student license, download the Ultimate edition; otherwise, download the Community edition.
- Install the Scala plugin.
- Optional: Set theme to Darcula.
- Linux users: Make desktop entry, by searching from settings create desktop entry.
Importing a Project
In this section, we show how to import a project for the Aalto University Scala programming courses. We use the CS-A1140 Data Structures and Algorithms course files as an example.
- Project dependensies:
- Project file. E.g.
Import Eclipse project files
- Open IntelliJ Idea
- Select the extracted project files folder. E.g.
- Choose to import as
- Keep pressing
nextand finally press
Setting up Scala SDK
- Set scala SDK by opening exercise file in IntelliJ and pop should suggest to setup scala SDK.
Setting up the dependencies
- Press the plus sign to add new dependencies
- Select all the
.jarfiles inside the
- Press OK