pekko/akka-docs/rst/intro/getting-started.rst

213 lines
6.7 KiB
ReStructuredText
Raw Normal View History

2011-04-09 19:55:46 -06:00
Getting Started
===============
Prerequisites
-------------
Akka requires that you have `Java 1.6 <http://www.oracle.com/technetwork/java/javase/downloads/index.html>`_ or
later installed on you machine.
Getting Started Guides and Template Projects
--------------------------------------------
The best way to start learning Akka is to download the Typesafe Stack and either try out
the Akka Getting Started Tutorials or check out one of Akka Template Projects. Both comes
in several flavours depending on your development environment preferences.
- `Download Typesafe Stack <http://typesafe.com/stack/download>`_
- `Getting Started Tutorials <http://typesafe.com/resources/getting-started>`_
- `Template Projects <http://typesafe.com/stack/download#template>`_
Download
--------
There are several ways to download Akka. You can download it as part of the Typesafe Stack
(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
-------
2011-04-09 19:55:46 -06:00
Akka is very modular and consists of several JARs containing different features.
- ``akka-actor`` -- Classic Actors, Typed Actors, IO Actor etc.
- ``akka-remote`` -- Remote Actors
- ``akka-testkit`` -- Toolkit for testing Actor systems
- ``akka-kernel`` -- Akka microkernel for running a bare-bones mini application server
- ``akka-transactor`` -- Transactors - transactional actors, integrated with Scala STM
- ``akka-agent`` -- Agents, integrated with Scala STM
- ``akka-camel`` -- Apache Camel integration
- ``akka-zeromq`` -- ZeroMQ integration
- ``akka-slf4j`` -- SLF4J Logger (event bus listener)
- ``akka-filebased-mailbox`` -- Akka durable mailbox (find more among community projects)
The filename of the actual JAR is for example ``@jarName@`` (and analog for
the other modules).
2011-04-09 19:55:46 -06:00
How to see the JARs dependencies of each Akka module is described in the
:ref:`dependencies` section.
Using a release distribution
----------------------------
2012-10-24 14:37:21 +02:00
Download the release you need from http://typesafe.com/stack/downloads/akka and unzip it.
Using a snapshot version
------------------------
The Akka nightly snapshots are published to http://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. The Akka
snapshots repository is also proxied through http://repo.typesafe.com/typesafe/snapshots/
which includes proxies for several other repositories that Akka modules depend on.
2011-04-09 19:55:46 -06:00
.. warning::
The use of Akka SNAPSHOTs, nightlies and milestone releases is discouraged unless you know what you are doing.
2011-04-09 19:55:46 -06:00
Microkernel
-----------
2011-04-09 19:55:46 -06:00
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.
2011-04-09 19:55:46 -06:00
More information is available in the documentation of the
:ref:`microkernel-scala` / :ref:`microkernel-java`.
2011-04-09 19:55:46 -06:00
Using a build tool
2011-04-11 21:26:13 -06:00
------------------
2011-04-09 19:55:46 -06:00
Akka can be used with build tools that support Maven repositories.
Maven repositories
------------------
For Akka version 2.1-M2 and onwards:
`Maven Central <http://repo1.maven.org/maven2/>`_
For previous Akka versions:
`Akka Repo <http://repo.akka.io/releases/>`_
`Typesafe Repo <http://repo.typesafe.com/typesafe/releases/>`_
2011-04-09 19:55:46 -06:00
Using Akka with Maven
---------------------
The simplest way to get started with Akka and Maven is to check out the
`Akka/Maven template <http://typesafe.com/resources/getting-started/typesafe-stack/downloading-installing.html#template-projects-for-scala-akka-and-play>`_
project.
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:
2011-04-09 19:55:46 -06:00
.. code-block:: xml
<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-actor_@binVersion@</artifactId>
<version>@version@</version>
2011-04-09 19:55:46 -06:00
</dependency>
**Note**: for snapshot versions both ``SNAPSHOT`` and timestamped versions are published.
2011-04-09 19:55:46 -06:00
Using Akka with SBT
-------------------
The simplest way to get started with Akka and SBT is to check out the
`Akka/SBT template <http://typesafe.com/resources/getting-started/typesafe-stack/downloading-installing.html#template-projects-for-scala-akka-and-play>`_
project.
2011-04-09 19:55:46 -06:00
Summary of the essential parts for using Akka with SBT:
2011-04-09 19:55:46 -06:00
2011-08-26 17:25:18 +02:00
SBT installation instructions on `https://github.com/harrah/xsbt/wiki/Setup <https://github.com/harrah/xsbt/wiki/Setup>`_
``build.sbt`` file:
.. parsed-literal::
2011-04-09 19:55:46 -06:00
2011-08-26 17:25:18 +02:00
name := "My Project"
2011-04-09 19:55:46 -06:00
2011-08-26 17:25:18 +02:00
version := "1.0"
2011-04-09 19:55:46 -06:00
scalaVersion := "@scalaVersion@"
2011-04-09 19:55:46 -06:00
2011-08-26 17:25:18 +02:00
resolvers += "Typesafe Repository" at "http://repo.typesafe.com/typesafe/releases/"
2011-04-09 19:55:46 -06:00
libraryDependencies +=
"com.typesafe.akka" %% "akka-actor" % "@version@" @crossString@
2011-04-09 19:55:46 -06:00
**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:
.. parsed-literal::
libraryDependencies +=
"com.typesafe.akka" % "akka-actor_@binVersion@" % "@version@"
Using Akka with Gradle
----------------------
Requires at least `Gradle <http://gradle.org>`_ 1.4
Uses the `Scala plugin <http://gradle.org/docs/current/userguide/scala_plugin.html>`_
.. parsed-literal::
apply plugin: 'scala'
repositories {
mavenCentral()
}
dependencies {
compile 'org.scala-lang:scala-library:@scalaVersion@'
}
tasks.withType(ScalaCompile) {
scalaCompileOptions.useAnt = false
}
dependencies {
compile group: 'com.typesafe.akka', name: 'akka-actor_@binVersion@', version: '@version@'
compile group: 'org.scala-lang', name: 'scala-library', version: '@scalaVersion@'
}
Using Akka with Eclipse
-----------------------
Setup SBT project and then use `sbteclipse <https://github.com/typesafehub/sbteclipse>`_ to generate a Eclipse project.
2011-08-26 17:25:18 +02:00
Using Akka with IntelliJ IDEA
-----------------------------
Setup SBT project and then use `sbt-idea <https://github.com/mpeltonen/sbt-idea>`_ to generate a IntelliJ IDEA project.
Using Akka with NetBeans
------------------------
Setup SBT project and then use `sbt-netbeans-plugin <https://github.com/remeniuk/sbt-netbeans-plugin>`_ to generate a NetBeans project.
2011-04-09 19:55:46 -06:00
Build from sources
2011-04-11 21:26:13 -06:00
------------------
2011-04-09 19:55:46 -06:00
Akka uses Git and is hosted at `Github <http://github.com>`_.
2012-03-05 10:27:00 +01:00
* Akka: clone the Akka repository from `<http://github.com/akka/akka>`_
2011-04-09 19:55:46 -06:00
Continue reading the page on :ref:`building-akka`
2011-04-09 19:55:46 -06:00
Need help?
2011-04-11 21:26:13 -06:00
----------
2011-04-09 19:55:46 -06:00
If you have questions you can get help on the `Akka Mailing List <http://groups.google.com/group/akka-user>`_.
2011-05-16 08:34:55 +02:00
You can also ask for `commercial support <http://typesafe.com>`_.
2011-04-09 19:55:46 -06:00
Thanks for being a part of the Akka community.