Scala plugin generates invalid Eclipse .classpath file

System: Windows 7 x64, JDK 1.7.0_04-b20 x64, Gradle 1.0 RC3

When I use the ‘scala’ plugin and the ‘eclipse’ plugin, and I generate an eclipse project for use with the official Eclipse based Scala-IDE, I get this entry in my .classpath file:

<classpathentry sourcepath="C:/Users/user/.gradle/caches/artifacts-13/filestore/org.scala-lang/scala-library/2.9.2/source/1c8e0222e53c7157befbf752bee474c7ab458eb4/scala-library-2.9.2-sources.jar" kind="lib" path="C:/Users/user/.gradle/caches/artifacts-13/filestore/org.scala-lang/scala-library/2.9.2/jar/55cf429e92d45524a548929a9d6e790205a0e61/scala-library-2.9.2.jar" exported="true"/>

This results in the Eclipse error “Cannot find Scala library on the classpath. Verify your build path!”

I found that replacing that entry with the following entry completely fixes the issue:

<classpathentry kind="lib" path="C:/Program Files/Java/scala-2.9.2/lib/scala-library.jar"/>

Bottom line, it looks like the Scala Eclipse project generation has a bug.


It’s just a regular entry in the .classpath file, and I cannot see anything wrong with it. Sounds more like a bug or limitation in Scala’s Eclipse plugin.

Unfortunately the Scala Eclipse IDE seems to require its Scala libraries to be in a library container. The link below gives a workaround, but it would be nice gradle did this natively.!topic/scala-ide-user/LuEBU4bA5eM‘no_Scala_library___’_or_‘More_than_one_Scala_library___’