IntelliJ IDEA 2024.1 Help

Get started with Scala

This section describes the Scala plugin in IntelliJ IDEA. You will find here information that should help you with your Scala development: an overview of the most important features, solutions to common issues, and tips to improve productivity. For more information about the plugin, take a look at the Scala landing page and the Scala blog.

Install the Scala plugin

If you already installed IntelliJ IDEA, and now you want to add Scala support to it, you need to download and enable the Scala plugin. If you run IntelliJ IDEA for the first time, you can install the Scala plugin when IntelliJ IDEA suggests downloading featured plugins. Otherwise, you can download the plugin manually.

Install the Scala plugin

This functionality relies on the Scala plugin, which you need to install and enable.

  1. Press Ctrl+Alt+S to open the IDE settings and then select Plugins.

  2. Open the Marketplace tab, find the Scala plugin, and click Install (restart the IDE if prompted).

Scala plugin page

Now you can create a new Scala project, import one from existing sources, or check it out from VCS.

Create a new Scala project

For a general overview of how to create new projects in IntelliJ IDEA, refer to Create a new project.

  1. On the Welcome screen, click New Project. Alternatively, in the main menu, go to File | New | Project.

  2. From the list on the left, select Scala.

  3. Name the new project and change its location if necessary.

  4. If you want, select the Create Git repository checkbox to place the new project under version control. If you decide not to, you will be able to do it later at any time.

    Creating a new Scala project with IntelliJ
  5. Select the IntelliJ build system. It's a native builder that doesn't require downloading additional artifacts.

  6. From the JDK list, select the JDK that you want to use in your project.

    If the JDK is installed on your computer, but not defined in the IDE, select Add JDK and specify the path to the JDK home directory.

    If you don't have the necessary JDK on your computer, select Download JDK.

  7. Similarly, from the Scala SDK list, select the SDK that you want to use in your project. If the SDK is not on the list, select Create. A new window will open with a longer list of Scala SDKs found on Ivy, Maven, and Coursier servers. You can choose one of them or select Browse and specify the path to the SDK home directory on your computer. Another option is to select Download, choose the Scala version you need, and IntelliJ IDEA will download it.

  8. If you want, enable the Add sample code option to create a file with a sample Hello World! application.

  9. Click Create.

Create a new Scala project with sbt

The majority of steps in this procedure is the same as in the procedure of creating a new Scala project with IntelliJ. The difference lies in choosing sbt as your build system.

If you want to learn more about how IntelliJ IDEA supports sbt, refer to sbt and sbt settings.

  1. From the list on the left, select Scala.

  2. Name the new project and change its location if necessary.

  3. If you want, select the Create Git repository checkbox to place the new project under version control. If you decide not to, you will be able to do it later at any time.

  4. From the JDK list, select the JDK that you want to use in your project.

    If the JDK is installed on your computer, but not defined in the IDE, select Add JDK and specify the path to the JDK home directory.

    If you don't have the necessary JDK on your computer, select Download JDK.

  5. Select the sbt build system.

  6. Choose sbt version from the drop-down list. If needed, you can also download its source code.

  7. Choose a Scala version from the drop-down list. Just as with sbt, you can also download its source code.

    Creating a new Scala project with sbt

Other ways to create a project

  • IntelliJ IDEA enables you to import a new project from existing sources. In the main menu, go to File | New | Project from Existing Sources and provide the path to the main folder of the project. To learn more, refer to Import and export projects.

  • You can also import a project from your Version Control Server. Select File | New | Project from Version Control and provide necessary data. IntelliJ IDEA will download and set up the project for you. To learn more, refer to Version control.

Plugin update channel

If you want early access to new plugin builds with the latest improvements, you can change the plugin Update channel:

  1. Press Ctrl+Alt+S to open the IDE settings and then select Languages & Frameworks | Scala.

  2. Open the Updates tab and change Update channel to one of three options:

    Scala Channel update
    • Stable Releases (default)

    • Early Access Program

      The first version is available ~2–3 months before the IntelliJ IDEA stable release. After IntelliJ IDEA is released, it will be updated multiple times between minor plugin bugfix releases.

    • Nightly Builds

      Plugin builds are uploaded every night with the latest improvements. The first version is available ~2–3 months before the major IntelliJ IDEA release. Nightly builds may contain changes that are not properly tested.

Last modified: 22 February 2024