Java and Scala (Akka library) problems


I'm using IntelliJ IDEA 10.0.3 and I'm beginning to use the Akka library.
I only use it within Java code, no Scala involved.

I have some problems with code completion and with the Java compiler within IntelliJ IDEA.

For example, when typing this line :

ActorRef myActor = Actors.actorOf(MyActor.class).start();

It compiles well with Maven, but the IDE tells me there's a compilation error :
"Cannot resolve method actorOf(java.lang.Class<MyActor>)"

The IDE then propose me to cast the MyActor.class statement, like this

ActorRef myActor = Actors.actorOf((Class<? extends>) MyActor.class);

which I find very annoying since it works well without it (and btw it's ugly) when I compile my project with Maven (and in other IDE's as well).

My question is, there a compiler warning or something related to the compiler's options that I should enable/disable in order to get rid of this ?

Thanks in advance.


Comment actions Permalink

Moreover, another annoying thing :

When I click on the "make" button, the compiler (which is Sun's one, version 1.6.0_24) tells me that
"MyClass is not abstract and does not override abstract method $tag() in scal.ScalaObject".

Adding/removing Scala facet doesn't help.

Comment actions Permalink

Disabling Scala plugin can help for pure Java project with Scala libraries, because of quite weak support of Java -> Scala compatibility (when Scala plugin is enabled, all appropriate class files decomiled as scala).
About make I think you'll get same results if you try to compile without IDEA. I mean that it's not IDEA's bug (or I'm wrong?).

Best regards,
Alexander Podkhalyuzin.

Comment actions Permalink

Hi Alexander,

Disabling the Scala plugin indeed helped with the cast I had to put in order to please the IDE.
But unfortunately the latter still complains about my class not implementing the $tag() method coming from scala.ScalaObject.
And I can assure you my project compiles perfectly with Maven launched within a console.

Any idea (pun intended ;)) ?


Comment actions Permalink

I still got the same problem over and over again, even with the latest 10.5 release.
The only way to totally get rid of it is to uninstall the Scala plugin, which, of course, is not a long-term option for me.
It's really annoying ...


Please sign in to leave a comment.