# Scala plugin generates invalid Eclipse .classpath file

**URL:** <https://discuss.gradle.org/t/scala-plugin-generates-invalid-eclipse-classpath-file/1373>\
**Category:** Old Forum Archive\
**Created:** [May 31, 2012, 12:00am UTC](https://discuss.gradle.org/t/scala-plugin-generates-invalid-eclipse-classpath-file/1373 "2012-05-31T00:00:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![clay](https://avatars.discourse-cdn.com/v4/letter/c/65b543/32.png) [@clay](https://discuss.gradle.org/u/clay)\
**Post date:** [May 31, 2012, 12:00am UTC](https://discuss.gradle.org/t/scala-plugin-generates-invalid-eclipse-classpath-file/1373/1 "2012-05-31T00:00:00Z")

</div>

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:

```gradle
<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:

```gradle
<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.

thanks!

---

<div class="post-metadata">

**Author:** ![Peter\_Niederwieser](https://avatars.discourse-cdn.com/v4/letter/p/9f8e36/32.png) [@Peter\_Niederwieser](https://discuss.gradle.org/u/Peter_Niederwieser)\
**Post date:** [May 31, 2012, 12:18am UTC](https://discuss.gradle.org/t/scala-plugin-generates-invalid-eclipse-classpath-file/1373/2 "2012-05-31T00:18:00Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![iainhull](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/iainhull/32/1245_2.png) [@iainhull](https://discuss.gradle.org/u/iainhull)\
**Post date:** [June 18, 2012, 10:14pm UTC](https://discuss.gradle.org/t/scala-plugin-generates-invalid-eclipse-classpath-file/1373/3 "2012-06-18T22:14:00Z")

</div>

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.

[https://groups.google.com/forum/?fromgroups#!topic/scala-ide-user/LuEBU4bA5eM](https://groups.google.com/forum/?fromgroups#!topic/scala-ide-user/LuEBU4bA5eM)

[http://scala-ide.org/docs/user/faq.html#Scala\_IDE\_complains\_about\_‘no\_Scala\_library\_\_\_’\_or\_‘More\_than\_one\_Scala\_library\_\_\_’](http://scala-ide.org/docs/user/faq.html#Scala_IDE_complains_about_%E2%80%98no_Scala_library ___%E2%80%99_or_%E2%80%98More_than_one_Scala_library___ %E2%80%99)
