{redirect:https://www.jetbrains.com/idea/help/creating-and-running-your-scala-application.html|delay=0} |
Getting Started with Scala in IntelliJ IDEA
Before you perform the tutorial's steps we recommend you to watch the video with a quick overview of Scala support in IntelliJ IDEA.
1. Install plugin
Before you create your first Scala application make sure
{span:class=id}Scala{span} |
plugin is installed and enabled via {span:class=shortcut}Settings{span} |
→ {span:class=shortcut}Plugins{span} |
.
2. Create Scala project with project wizard
Open
{span:class=shortcut}Project Wizard{span} |
and select Scala template. Specify home directory for Scala. If you don't have it, you can get it via Download button.

It will be easier next time to create applications if you select to make global libraries.

3. Check project libraries
Open
{span:class=shortcut}Project Structure{span} |
and check the project libraries. Here you can configure additional libraries, e.g. ScalaTest or any others.

Check compiler settings
In
{span:class=shortcut}Scala Facet{span} |
settings you can check {span:class=shortcut}Compiler options{span} |
.

4. Create object
The easiest way to create Scala file, worksheet or script is to use
{span:class=shortcut}Ctrl{span} |
+ {span:class=shortcut}N{span} |
shortcut from {span:class=shortcut}Project View{span} |
or {span:class=shortcut}Navigation Bar{span} |
.

Choose between class, object and trait with
{span:class=shortcut}Up{span} |
and {span:class=shortcut}Down{span} |
arrows.

5. Run application
The fastest way to run the code at cursor is to use
{span:class=shortcut}Ctrl{span} |
+ {span:class=shortcut}Shift{span} |
+ {span:class=shortcut}F10{span} |
shortcut.

Alternatively you can use the context menu.
