The Eclipse Scala plugin sometimes gives me bogus compilation errors saying “class file needed by some class is missing”. This may be related to the fact that my project depends on other projects in the same workspace. Cleaning the project – even cleaning all open projects – does not resolve these errors. How can I make them go away?
The Eclipse Scala plugin sometimes gives me bogus compilation errors saying class file needed
Share
This can be caused by having two different versions of the same jar in the classpath (or, I suppose, by having just an old binary-incompatible version of a jar in the classpath). You can use a classpath checking tool like JBoss Tattletale to detect problems like this.
Here is an example Tattletale command line for analysing a project where all the jars are in the
libsubdirectory:Tattletale will create the report directory (the last argument) if it does not already exist. There are also versions of Tattletale for Maven and Ant projects.
Then open the file
in your web browser, and look around, particularly at pages like “Eliminate Jar files with different versions” and “Multiple jar files”. Those pages will be empty if no problems of that type have been found.