views:

82

answers:

1

I have a project with mixed Java and Scala sources, following the instructions on this page, which works when running Maven from the command line.

However, people using IDEs like IDEA and Netbeans have problems resolving Scala classes in Java code (but not the other way around, thanks to the nice plugins available). Is there a way to resolve them?

Note: I can build from the command line just fine; the Scala classes are compiled before the Java classes. I just want the IDE to recognize this as well. I could create a separate module for the Scala classes to resolve this problem, but it seems like overkill to me.

Note: In IDEA, I have "Compile Scala classes first" and that still does not do the trick.

Update: Here are the versions I'm using: scala-library 2.8.0 maven-scala-plugin 2.12 IDEA 9.0 Ultimate with latest scala plugin from plugin repos Netbeans 6.9 with scala nightly plugin

+2  A: 

Which versions (of Scala, the IDEs, the Scala plugins) are you using?

I had the same issues when I started using Scala 2.7 around 9 months ago. While I haven't tried a mixed project recently, my understanding was that the issues would be resolved in Scala 2.8. It may be worth trying Eclipse 3.5.2 with Scala 2.8 -- my impression is that the Eclipse plugin is keeping up with changes in 2.8 better than the other IDE plugins (but I could be wrong).

Aaron Novstrup
Yup. Eclipse 3.5.2 with Scala 2.8 is working well for me. I can resolve Scala classes within Java code. Thanks!
retiman
@retiman I wonder if using the EAP version of IDEA would work. I recently ported a 2.7.7 codebase to 2.8, and switching to the EAP version resolved a bunch of issues for me.
Aaron Novstrup