0
votes

I'm confused about needing Akka for the current version of Actors in scala.

When I look at: https://en.wikipedia.org/wiki/Akka_(toolkit) I get the idea that Akka is included in the scala library, from the line "Akka is written in Scala and, as of Scala 2.10, Akka's actor implementation is included as part of the Scala standard library.[3]"

And yet when I try to use, say, this Ping Pong example:http://alvinalexander.com/scala/scala-akka-actors-ping-pong-simple-example I get dependency errors. Here's the specific one:

Error:scalac: missing or invalid dependency detected while loading class file 'ActorSystem.class'. Could not access term typesafe in package com, because it (or its dependencies) are missing. Check your build definition for missing or conflicting dependencies. (Re-run with -Ylog-classpath to see the problematic classpath.) A full rebuild may help if 'ActorSystem.class' was compiled against an incompatible version of com.

When I pull up my global scala library in IntelliJ, I can see I have the akka jars in my default scala install at

  1. C:\Program Files (x86)\scala\lib\akka-actor_2.11-2.3.10.jar
  2. C:\Program Files (x86)\scala\lib\scala-actors-2.11.0.jar etc

Other sources claim I need to download the Akka library, but that isn't an option for me at the moment. My code needs to run on just the current default scala build. I'll forgo using Akka if need be.

2

2 Answers

1
votes

Akka Actors are not available in Scala Standard lib.

The actors available in standard lib are called scala actors.

Akka actors are actively developed and used by the community. So use Akka actors instead of Scala Actors

0
votes

you will probably still need to include the classpath - at the moment they are just installed, you need to tell java where it should use them

java -classpath "C:\Program Files (x86)\scala\lib\akka-actor_2.11-2.3.10.jar"