This page is no longer maintained — Please continue to the home page at www.scala-lang.org

Workaround: Exporting Eclipse 3.5 plugins using Scala fails

No replies
Marcus Wendt
Joined: 2009-09-05,
User offline. Last seen 42 years 45 weeks ago.

Hello,

thought id post this here, since this problem kept me busy for a quite
a while and it seems there is no immediate solution at the horizon.

Task: You want to create an Eclipse plugin in Scala or using classes
from a Scala library.
Problem: Exporting the project using the Eclipse RCP plugin or product
dialogues fails because of:
"The type scala.ScalaObject cannot be resolved. It is indirectly
referenced from required .class files" errors.

More precisely; when Eclipse exports a bundle it seems to create an
ant buildfile that calls:
- which is
where the compilation process fails.

Miles Sabin says: "...for this to work the
PDE would have to be aware of the scalac Ant task and include it in
that temporary Ant script as appropriate. Unfortunately that's not the
case at the moment..."

Workaround: Hidden in the plugin export dialog is an option to "use
the class files compiled in the
workspace" which circumvents this problem and simply packages you
bin/* classes into a plugin.

The only problem is that this option only exists for plugins not for
products - so in the case of a product (e.g. an editor application
generated from an EMF model) you have to export the product with
failures first and then each scala dependend plugin seperately (using
the option mentioned above), replacing the corrupt ones in the
product.

Hope this makes sense and saves someone from experiencing the same frustrations.

Best
Marcus

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland