Getting Started
§Getting Started Guides and Template Projects
The best way to start learning Akka is to download Typesafe Activator and try out one of Akka Template Projects.
§Download
There are several ways to download Akka. You can download it as part of the Typesafe Platform (as described above). You can download the full distribution with microkernel, which includes all modules. Or you can use a build tool like Maven or SBT to download dependencies from the Akka Maven repository.
§Modules
Akka is very modular and consists of several JARs containing different features.
akka-actor
– Classic Actors, Typed Actors, IO Actor etc.akka-agent
– Agents, integrated with Scala STMakka-camel
– Apache Camel integrationakka-cluster
– Cluster membership management, elastic routers.akka-kernel
– Akka microkernel for running a bare-bones mini application serverakka-osgi
– base bundle for using Akka in OSGi containers, containing theakka-actor
classesakka-osgi-aries
– Aries blueprint for provisioning actor systemsakka-remote
– Remote Actorsakka-slf4j
– SLF4J Logger (event bus listener)akka-testkit
– Toolkit for testing Actor systemsakka-zeromq
– ZeroMQ integration
In addition to these stable modules there are several which are on their way into the stable core but are still marked “experimental” at this point. This does not mean that they do not function as intended, it primarily means that their API has not yet solidified enough in order to be considered frozen. You can help accelerating this process by giving feedback on these modules on our mailing list.
akka-contrib
– an assortment of contributions which may or may not be moved into core modules, see External Contributions for more details.
The filename of the actual JAR is for example akka-actor_2.12-2.3.16.jar
(and analog for
the other modules).
How to see the JARs dependencies of each Akka module is described in the Dependencies section.
§Using a release distribution
Download the release you need from https://akka.io/downloads and unzip it.
§Using a snapshot version
The Akka nightly snapshots are published to https://repo.akka.io/snapshots/ and are
versioned with both SNAPSHOT
and timestamps. You can choose a timestamped
version to work with and can decide when to update to a newer version.
Warning
The use of Akka SNAPSHOTs, nightlies and milestone releases is discouraged unless you know what you are doing.
§Microkernel
The Akka distribution includes the microkernel. To run the microkernel put your
application jar in the deploy
directory and use the scripts in the bin
directory.
More information is available in the documentation of the Microkernel (Scala) / Microkernel (Java).
§Using a build tool
Akka can be used with build tools that support Maven repositories.
§Using Akka with Maven
The simplest way to get started with Akka and Maven is to check out the Typesafe Activator tutorial named Akka Main in Java.
Since Akka is published to Maven Central (for versions since 2.1-M2), is it enough to add the Akka dependencies to the POM. For example, here is the dependency for akka-actor:
- <dependency>
- <groupId>com.typesafe.akka</groupId>
- <artifactId>akka-actor_2.12</artifactId>
- <version>2.3.16</version>
- </dependency>
Note: for snapshot versions both SNAPSHOT
and timestamped versions are published.
§Using Akka with SBT
The simplest way to get started with Akka and SBT is to check out the Akka/SBT template project.
Summary of the essential parts for using Akka with SBT:
SBT installation instructions on https://github.com/harrah/xsbt/wiki/Setup
build.sbt
file:
- name := "My Project"
-
- version := "1.0"
-
- scalaVersion := "2.10.4"
-
- libraryDependencies +=
- "com.typesafe.akka" %% "akka-actor" % "2.3.16"
Note: the libraryDependencies setting above is specific to SBT v0.12.x and higher. If you are using an older version of SBT, the libraryDependencies should look like this:
- libraryDependencies +=
- "com.typesafe.akka" % "akka-actor_2.12" % "2.3.16"
§Using Akka with Gradle
Requires at least Gradle 1.4 Uses the Scala plugin
- apply plugin: 'scala'
-
- repositories {
- mavenCentral()
- }
-
- dependencies {
- compile 'org.scala-lang:scala-library:2.10.4'
- }
-
- tasks.withType(ScalaCompile) {
- scalaCompileOptions.useAnt = false
- }
-
- dependencies {
- compile group: 'com.typesafe.akka', name: 'akka-actor_2.12', version: '2.3.16'
- compile group: 'org.scala-lang', name: 'scala-library', version: '2.10.4'
- }
§Using Akka with Eclipse
Setup SBT project and then use sbteclipse to generate a Eclipse project.
§Using Akka with IntelliJ IDEA
Setup SBT project and then use sbt-idea to generate a IntelliJ IDEA project.
§Using Akka with NetBeans
Setup SBT project and then use nbsbt to generate a NetBeans project.
You should also use nbscala for general scala support in the IDE.
§Do not use -optimize Scala compiler flag
Warning
Akka has not been compiled or tested with -optimize Scala compiler flag. Strange behavior has been reported by users that have tried it.
§Build from sources
Akka uses Git and is hosted at Github.
- Akka: clone the Akka repository from http://github.com/akka/akka
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.
Contents
- Prerequisites
- Getting Started Guides and Template Projects
- Download
- Modules
- Using a release distribution
- Using a snapshot version
- Microkernel
- Using a build tool
- Maven repositories
- Using Akka with Maven
- Using Akka with SBT
- Using Akka with Gradle
- Using Akka with Eclipse
- Using Akka with IntelliJ IDEA
- Using Akka with NetBeans
- Do not use -optimize Scala compiler flag
- Build from sources
- Need help?