Getting Started¶
The best way to start learning Akka is to try the Getting Started Tutorial, which comes in several flavours depending on you development environment preferences:
- Getting Started Tutorial (Java): First Chapter for Java development, either
- as standalone project, running from the command line,
- or as Maven project and running it from within Maven
- Getting Started Tutorial (Scala): First Chapter for Scala development, either
- as standalone project, running from the command line,
- or as SBT (Simple Build Tool) project and running it from within SBT
- Getting Started Tutorial (Scala with Eclipse): First Chapter for Scala development with Eclipse
The Getting Started Tutorial describes everything you need to get going, and you don’t need to read the rest of this page if you study the tutorial. For later look back reference this page describes the essential parts for getting started with different development environments.
Prerequisites¶
Akka requires that you have Java 1.6 or later installed on you machine.
Download¶
There are several ways to download Akka. You can download the full distribution with microkernel, which includes all modules. You can download just the core distribution. Or you can use a build tool like Maven or SBT to download dependencies from the Akka Maven repository.
Modules¶
Akka is split up into two different parts:
- Akka - The core modules. Reflects all the sections under Scala API and Java API.
- Akka Modules - The microkernel and add-on modules, described in Add-on Modules.
Akka is very modular and has many JARs for containing different features. The core distribution has seven modules:
- akka-actor-1.1.3.jar – Standard Actors
- akka-typed-actor-1.1.3.jar – Typed Actors
- akka-remote-1.1.3.jar – Remote Actors
- akka-stm-1.1.3.jar – STM (Software Transactional Memory), transactors and transactional datastructures
- akka-http-1.1.3.jar – Akka Mist for continuation-based asynchronous HTTP and also Jersey integration
- akka-slf4j-1.1.3.jar – SLF4J Event Handler Listener
- akka-testkit-1.1.3.jar – Toolkit for testing Actors
We also have Akka Modules containing add-on modules outside the core of Akka.
- akka-kernel-1.1.3.jar – Akka microkernel for running a bare-bones mini application server (embeds Jetty etc.)
- akka-amqp-1.1.3.jar – AMQP integration
- akka-camel-1.1.3.jar – Apache Camel Actors integration (it’s the best way to have your Akka application communicate with the rest of the world)
- akka-camel-typed-1.1.3.jar – Apache Camel Typed Actors integration
- akka-scalaz-1.1.3.jar – Support for the Scalaz library
- akka-spring-1.1.3.jar – Spring framework integration
- akka-osgi-dependencies-bundle-1.1.3.jar – OSGi support
How to see the JARs dependencies of each Akka module is described in the Dependencies section. Worth noting is that akka-actor has zero external dependencies (apart from the scala-library.jar JAR).
Using a release distribution¶
Download the release you need, Akka core or Akka Modules, from https://akka.io/downloads and unzip it.
Microkernel¶
The Akka Modules distribution includes the microkernel. To run the microkernel:
- Set the AKKA_HOME environment variable to the root of the Akka distribution.
- To start the kernel use the scripts in the bin directory and deploy all samples applications from ./deploy dir.
More information is available in the documentation of the Microkernel in Add-on Modules.
Using a build tool¶
Akka can be used with build tools that support Maven repositories. The Akka Maven repository can be found at https://akka.io/repository.
Using Akka with Maven¶
Information about how to use Akka with Maven, including how to create an Akka Maven project from scratch, can be found in the Getting Started Tutorial (Java): First Chapter.
Summary of the essential parts for using Akka with Maven:
- Add this repository to your pom.xml:
<repository>
<id>Akka</id>
<name>Akka Maven2 Repository</name>
<url>https://akka.io/repository/ </url>
</repository>
- Add the Akka dependencies. For example, here is the dependency for Akka Actor 1.1.3:
<dependency>
<groupId>se.scalablesolutions.akka</groupId>
<artifactId>akka-actor</artifactId>
<version>1.1.3</version>
</dependency>
Using Akka with SBT¶
Information about how to use Akka with SBT, including how to create an Akka SBT project from scratch, can be found in the Getting Started Tutorial (Scala): First Chapter.
Summary of the essential parts for using Akka with SBT:
- Akka has an SBT plugin which makes it very easy to get started with Akka and SBT.
The Scala version in your SBT project needs to match the version that Akka is built against. For Akka 1.1.3 this is Scala version 2.9.0-1.
To use the plugin, first add a plugin definition to your SBT project by creating project/plugins/Plugins.scala with:
import sbt._
class Plugins(info: ProjectInfo) extends PluginDefinition(info) {
val akkaRepo = "Akka Repo" at "https://akka.io/repository"
val akkaPlugin = "se.scalablesolutions.akka" % "akka-sbt-plugin" % "1.1.3"
}
Note: the plugin version matches the Akka version provided. The current release is 1.1.3.
- Then mix the AkkaProject trait into your project definition. For example:
class MyProject(info: ProjectInfo) extends DefaultProject(info) with AkkaProject
Note: This adds akka-actor as a dependency by default.
If you also want to include other Akka modules there is a convenience method: akkaModule. For example, you can add extra Akka modules by adding any of the following lines to your project class:
val akkaStm = akkaModule("stm")
val akkaTypedActor = akkaModule("typed-actor")
val akkaRemote = akkaModule("remote")
val akkaHttp = akkaModule("http")
val akkaAmqp = akkaModule("amqp")
val akkaCamel = akkaModule("camel")
val akkaCamelTyped = akkaModule("camel-typed")
val akkaSpring = akkaModule("spring")
Using Akka with Eclipse¶
Information about how to use Akka with Eclipse, including how to create an Akka Eclipse project from scratch, can be found in the Getting Started Tutorial (Scala with Eclipse): First Chapter.
Using Akka with IntelliJ IDEA¶
Setup SBT project and then use sbt-idea to generate IntelliJ IDEA project.
Build from sources¶
Akka uses Git and is hosted at Github.
- Akka: clone the Akka repository from http://github.com/akka/akka
- Akka Modules: clone the Akka Modules repository from http://github.com/akka/akka-modules
Continue reading the page on Building Akka
Need help?¶
If you have questions you can get help on the Akka Mailing List.
You can also ask for commercial support.
Thanks for being a part of the Akka community.