Reputation: 1058
I wish to use the Akka actor modules. I am using Eclipse in Kubuntu. I downloaded the .zip archive from the akka website, went to:
Project->Properties->Java Build Path->Libraries->Add External Jar
and added all jars that came with the zip.
In my code, I do:
import akka.actor.Actor;
import akka.event.EventHandler;
class MyActor extends Actor{
}
and I get a straight error in line:
class myActor extends Actor{
Error is:
The type Actor cannot be the superclass of MyActor; a superclass must be a class
But isn't Actor supposed to be a class? At least that is what all the tutorials say.
Upvotes: 0
Views: 952
Reputation: 1534
Try with akka.actor.UntypedActor
. From the reference documentation:
Actor in Java are implemented by extending the UntypedActor class and implementing the onReceive method. This method takes the message as a parameter.
Here's an example: https://github.com/alexaverbuch/akka_chat_java/blob/master/src/main/java/chat/actors/Session.java
Upvotes: 2