Scala REPL in Eclipse does not see my own classes
-
21-12-2020 - |
문제
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.