I created a Java / Maven project in Eclipse, and added the Scala nature. Eclipse can compile my Scala classes (when they are correct), but if I create a Scala interpreter in the project, I cannot import my classes in it. It says my root package does not exist. What am I doing wrong?

有帮助吗?

解决方案

This seems to work correctly in the latest version of Scala Eclipse Plugin (2.0.0.beta09). Do you still have the problem?

其他提示

OK. Just for the records. I'm not sure why it didn't work when I first posted this. But I know why it doesn't work now.

If I have any error at all in my Scala code, in any source file, the compiler doesn't produce any compiled class at all! This is totally different from Java. I am programming Java at work, and I'm often running apps in workspaces where a dozen of irrelevant files don't compile without problems.

I find this a very strange behavior. I can't imagine any of our developer PCs being powerful enough to compile 1.6M lines of (Java) code in memory before writing the class files to disk.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top