0

i hava a project with scala and java code.

i access a scala class via AB$.MODULE$ as can be seen in the solution/comment here: access case object (scala) from java

everything works fine, however, eclipse underlines AB$.MODULE$ with red color saying that AB$ cannot be resolved to a variable. however, the code compiles correctly and works fine. so how can i avoid the error from eclipse?

Community
  • 1
  • 1
beta
  • 5,324
  • 15
  • 57
  • 99

1 Answers1

0

I run into this problem fairly regularly. What works for me is cleaning the project in Eclipse. Just click on the project then Project->Clean.

If you are using Maven you can also try updating your Eclipse project with your Maven dependencies. Right click on project then Maven->Update project.

Hope this helps

ewanc
  • 1,284
  • 1
  • 12
  • 23
  • good hint. unfortunately it did not help in my specific case. it seems to be some sort of java-scala-interoperability problem. eclipse seems not to be fully okay with the `AB$.MODULE$` accessor.. – beta Apr 15 '15 at 07:37