# Akka support

> **TL;DR**
> Required plugin: Scala: [how to install](get-started-with-scala.html#scala_plugin)

[Akka](https://akka.io) is a toolkit for building highly concurrent, distributed, and resilient message-driven applications for Scala. IntelliJ IDEA supports the [latest stable Akka version](https://akka.io/docs/other-releases.html).

Procedure: Add the Akka support to a project

The easiest way to add the Akka support to IntelliJ IDEA is to use the [sbt](sbt-support.html) project.

1. [Create](get-started-with-scala.html#new-scala-project-sbt) or [open](sbt-support.html#import_sbt) an sbt project in IntelliJ IDEA.

2. Open the `build.sbt` file in the editor.

3. Add the following code to `build.sbt`:

```
libraryDependencies += "com.typesafe.akka" %% "akka-actor" % "2.6.20"
```

4. If you need, [reimport](sbt-support.html) the changes made to the `build.sbt` file.

After you finish setting up the Akka support,  you can develop your application further the same way you do with any other project.

## Work with Akka code in the editor

Besides basic code completion, code generation, and code navigation support, IntelliJ IDEA supports Akka inspections, find usages with Akka context, and specific code generation actions for Akka.

Procedure: Use Akka code inspections

You can check the list of available Akka inspections and their descriptions in  the Editor | Inspections settings page `Ctrl+Alt+S` (Windows), `⌘ Comma` (macOS), `⌘ Comma` (IntelliJ IDEA Classic (macOS)), `⌘ Comma` (macOS System Shortcuts), `Ctrl+Alt+S` (XWin), `Ctrl+Alt+S` (GNOME), `Ctrl+Alt+S` (KDE), `Ctrl+Alt+S` (Emacs), `Ctrl+Alt+S` (Sublime Text), `⌘ Comma` (Sublime Text (macOS)), `Ctrl+Alt+S` (NetBeans), `Ctrl+Alt+S` (Visual Studio), `⌘ Comma` (Visual Studio (macOS)), `Ctrl+Alt+S` (Eclipse), `⌘ Comma` (Eclipse (macOS)) .

![the Inspections settings](https://resources.jetbrains.com/help/img/idea/2026.2/akka_inspections.png)

In the editor, IntelliJ IDEA displays suggestion hints where the inspections could work, and you can check the following examples with suggested changes that might improve your code:

* Replace dynamic invocation with a constructor invocation: part of code could be simplified with a replacement.

![Active editor](https://resources.jetbrains.com/help/img/idea/2026.2/factory_method_simplified.png)

Code example:

Before:

```SCALA
import akka.actor._

  abstract class Foo extends AbstractActor

  object Foo {
      def props: Props = Props(classOf[Foo])
  }
```

After:

```SCALA
import akka.actor._

    abstract class Foo extends AbstractActor

    object Foo {
        def props: Props = Props(new Foo())
    }
```

* Replace with a factory method call: dynamic constructor call could be safely replaced with a factory method call.

![Intention Action](https://resources.jetbrains.com/help/img/idea/2026.2/replace_with_factory_methodcall.png)

Code example:

Before:

```SCALA
import akka.actor._

class Foo(foo: String, bar: Int) extends AbstractActor {
    override def createReceive(): AbstractActor.Receive = ???
}

object Foo {
    def props(foo: String, bar: Int): Props = Props(new Foo(foo, bar))
}

Props(classOf[Foo], "foo", 42)
```

After:

```SCALA
import akka.actor._

class Foo(foo: String, bar: Int) extends AbstractActor {
    override def createReceive(): AbstractActor.Receive = ???
}

object Foo {
    def props(foo: String, bar: Int): Props = Props(new Foo(foo, bar))
}

Foo.props("foo", 42)
```

* Appropriate actor constructor not found: the inspection will work in a place where a constructor with inappropriate arguments is called.

![Actor constructor not found](https://resources.jetbrains.com/help/img/idea/2026.2/akka_actor_constructor.png)

* Akka mutable state: the inspection detects if the Actor has a mutable state.

Code example:

Before:

```SCALA
import scala.collection.mutable

class MyActor extends Actor {
    val isInSet = mutable.Set.empty[String]

    def receive = {
        case Add(key) =>
            isInSet += key

        case Contains(key) =>
            sender() ! isInSet(key)
    }
}
```

After:

```SCALA
import collection.immutable.Set

class MyActor extends Actor {
    def receive = active(Set.empty)

    def active(isInSet: Set[String]): Receive = {
        case Add(key) =>
            context become active(isInSet + key)

        case Contains(key) =>
            sender() ! isInSet(key)
    }
}
```

Procedure: Use intentions in Akka

You can check the list of available intention actions for Scala and Akka in  the Editor | Inspections settings page `Ctrl+Alt+S` (Windows), `⌘ Comma` (macOS), `⌘ Comma` (IntelliJ IDEA Classic (macOS)), `⌘ Comma` (macOS System Shortcuts), `Ctrl+Alt+S` (XWin), `Ctrl+Alt+S` (GNOME), `Ctrl+Alt+S` (KDE), `Ctrl+Alt+S` (Emacs), `Ctrl+Alt+S` (Sublime Text), `⌘ Comma` (Sublime Text (macOS)), `Ctrl+Alt+S` (NetBeans), `Ctrl+Alt+S` (Visual Studio), `⌘ Comma` (Visual Studio (macOS)), `Ctrl+Alt+S` (Eclipse), `⌘ Comma` (Eclipse (macOS)) .

![Akka intentions settings](https://resources.jetbrains.com/help/img/idea/2026.2/akka_intentions.png)

In the editor, IntelliJ IDEA displays the ![the Intention action icon](https://resources.jetbrains.com/help/img/idea/2026.2/app.expui.codeInsight.intentionBulb.png) popup with suggestions to improve your code. Check the following examples of the related intentions for Akka:

* Generate actor factory methods: IntelliJ IDEA supports the automatic generation of factory methods. In the editor, place the caret inside the companion object of an `Actor`, press `Alt+Insert` (Windows), `⌘ N` (macOS), `⌃ N` (IntelliJ IDEA Classic (macOS)), `⌘ N` (macOS System Shortcuts), `Alt+Insert` (XWin), `Alt+Insert` (GNOME), `Alt+Insert` (KDE), `Alt+Insert` (Emacs), `Alt+Insert` (Sublime Text), `⌘ N` (Sublime Text (macOS)), `Alt+Insert` (NetBeans), `Alt+Insert` (Visual Studio), `⌘ ⌃ N` (Visual Studio (macOS)), `Alt+Insert` (Eclipse), `⌘ N` (Eclipse (macOS)) and select the intention.

[Video](https://resources.jetbrains.com/help/img/idea/2026.2/generate_factory_method.mp4)

* Create a corresponding factory method: IntelliJ IDEA supports the automatic generation of the corresponding factory methods.

[Video](https://resources.jetbrains.com/help/img/idea/2026.2/create_corresponding_method.mp4)

* IntelliJ IDEA supports intentions for refactorings. For example, when you extract variable `Ctrl+Alt+V` (Windows), `⌘ ⌥ V` (macOS), `⌘ ⌥ V` (IntelliJ IDEA Classic (macOS)), `⌘ ⌥ V` (macOS System Shortcuts), `Ctrl+Alt+V` (XWin), `Ctrl+Alt+V` (GNOME), `Alt+Shift+V` (KDE), `Ctrl+Alt+V` (Emacs), `Ctrl+Alt+V` (Sublime Text), `Ctrl+Alt+V` (Sublime Text (macOS)), `Alt+Shift+V` (NetBeans), `Ctrl+R, V` (Visual Studio), `⌘ R, V` (Visual Studio (macOS)), `Alt+Shift+L` (Eclipse), `⌘ ⌥ L` (Eclipse (macOS)), IntelliJ IDEA will suggest a name and a type for the inline refactoring.

[Video](https://resources.jetbrains.com/help/img/idea/2026.2/akka_extract_var.mp4)

