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

2.8.0 Eclipse plugin, known problem?

3 replies
dr2chase
Joined: 2009-03-07,
User offline. Last seen 3 years 34 weeks ago.

I'm attempting to upgrade from 2.7.7 to 2.8.0, in a large project with mixed Java and Scala. The ant build is compiling fine. I've upgraded pretty near everything on my box (OS, Java, Eclipse, and now the Scala plugin). With everything already compiled (by ant build), when I start Eclipse, the first thing I see in the Error Log is "Failure in Presentation Compiler" that is accompanied by this stack trace:

scala.tools.nsc.FatalError: trait Product does not have a member productElementName
at scala.tools.nsc.symtab.Definitions$definitions$.getMember(Definitions.scala:487)
at scala.tools.nsc.typechecker.SyntheticMethods$class.everywhereMethods$1(SyntheticMethods.scala:283)
at scala.tools.nsc.typechecker.SyntheticMethods$class.addSyntheticMethods(SyntheticMethods.scala:295)
at scala.tools.nsc.Global$analyzer$.addSyntheticMethods(Global.scala:292)
at scala.tools.nsc.typechecker.Typers$Typer.typedClassDef(Typers.scala:1309)
at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:3771)
at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:4116)
at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:3800)
at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:4116)
at scala.tools.nsc.typechecker.Typers$Typer.typedStat$1(Typers.scala:2125)
at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$20.apply(Typers.scala:2193)
at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$20.apply(Typers.scala:2193)
at scala.collection.immutable.List.loop$1(List.scala:116)
at scala.collection.immutable.List.mapConserve(List.scala:133)
at scala.collection.immutable.List.loop$1(List.scala:120)
at scala.collection.immutable.List.mapConserve(List.scala:133)
at scala.collection.immutable.List.loop$1(List.scala:120)
at scala.collection.immutable.List.mapConserve(List.scala:133)
at scala.collection.immutable.List.loop$1(List.scala:120)
at scala.collection.immutable.List.mapConserve(List.scala:133)
etc

Below that error, is what I believe is a set of four locations, of the form
AT: RangePosition(STypesUtil.scala, 761, 796, 47436)

I'm assuming this has to be some sort of library version skew, since the word "Product" does not appear in any Scala or Java files in the project.

Here's my current set of clues:

I noticed, upon rummaging around in the Eclipse plugins, that even though I had "uninstalled" the 2.7.7 version, the jar file was still there:

dr2chase:eclipse-3.5-cocoa dr2chase$ find . -name "*scala*" -print
./configuration/org.eclipse.osgi/bundles/433/1/.cp/lib/scala-dbc-src.jar
./configuration/org.eclipse.osgi/bundles/433/1/.cp/lib/scala-dbc.jar
./configuration/org.eclipse.osgi/bundles/433/1/.cp/lib/scala-library-src.jar
./configuration/org.eclipse.osgi/bundles/433/1/.cp/lib/scala-library.jar
./configuration/org.eclipse.osgi/bundles/433/1/.cp/lib/scala-swing-src.jar
./configuration/org.eclipse.osgi/bundles/433/1/.cp/lib/scala-swing.jar
./plugins/scala.library_2.7.7.final.jar
./plugins/scala.library_2.8.0.r21030-b20100302020059.jar
./plugins/scala.tools.nsc_2.7.7.final.jar
./plugins/scala.tools.nsc_2.8.0.r21030-b20100302020059.jar

I deleted that jar file, the problem remained.

I noticed, also, that there were TWO remaining versions of "scala library".jar known to Eclipse, and they are different:

dr2chase:eclipse-3.5-cocoa dr2chase$ ls -l ./configuration/org.eclipse.osgi/bundles/433/1/.cp/lib/scala-library.jar
-rw-r--r-- 1 dr2chase staff 5117384 Mar 2 12:11 ./configuration/org.eclipse.osgi/bundles/433/1/.cp/lib/scala-library.jar

dr2chase:eclipse-3.5-cocoa dr2chase$ ls -l ./plugins/scala.library_2.8.0.r21030-b20100302020059.jar
-rw-r--r-- 1 dr2chase staff 6556013 Mar 2 12:07 ./plugins/scala.library_2.8.0.r21030-b20100302020059.jar

FURTHERMORE, neither one of them is the "scala library" that comes with "2.8.0Beta1":

dr2chase:scala dr2chase$ ls -l scala-library-2.8.0Beta1.jar
-rw-r--r--@ 1 dr2chase staff 4810593 Feb 2 12:33 scala-library-2.8.0Beta1.jar

SO, I think I have a configuration problem, and what I am curious to know is, what is the right way to get my Scala source code in Eclipse hooked up with the proper library? 2.8.0.Beta1-prerelease is proven to work; can I use that? If so, how? I have tried setting the build path for the project, and that is what it references, and I get this outcome.

Or should I reinstall Eclipse from scratch, plugins and all?
(That sounds most likely to succeed, eventually, if success is possible. Yuck. Still, it probably finishes faster than this can be figured out from clues.)

David

Stephen Haberman
Joined: 2009-07-17,
User offline. Last seen 42 years 45 weeks ago.
Re: 2.8.0 Eclipse plugin, known problem?

> I'm assuming this has to be some sort of library version skew, since
> the word "Product" does not appear in any Scala or Java files in the
> project.

Yes, the nightly Eclipse plugin requires the nightly library being on
your project's classpath.

I found the easiest thing was to keep scala-2.8.0-beta1 on the path for
ant/etc., but then just put the scala container (which is whatever version
the plugin is) in the .classpath file first.

E.g.:

»x

dr2chase
Joined: 2009-03-07,
User offline. Last seen 3 years 34 weeks ago.
Re: 2.8.0 Eclipse plugin, known problem?

Wow, thanks. It now fails differently, which is progress.

Legal Java code now gets dinged for "Scala problems", according
to Eclipse's problem viewer. I suspect that is also a known bug.
It persists across cleans and rebuilds.

It's failing to find nested static types (50 times), at least some of them.

Any clues for that one?

David

On 2010-03-02, at 1:35 PM, Stephen Haberman wrote:

>
>> I'm assuming this has to be some sort of library version skew, since
>> the word "Product" does not appear in any Scala or Java files in the
>> project.
>
> Yes, the nightly Eclipse plugin requires the nightly library being on
> your project's classpath.
>
> I found the easiest thing was to keep scala-2.8.0-beta1 on the path for
> ant/etc., but then just put the scala container (which is whatever version
> the plugin is) in the .classpath file first.
>
> E.g.:
>
> »x »x

Stephen Haberman
Joined: 2009-07-17,
User offline. Last seen 42 years 45 weeks ago.
Re: 2.8.0 Eclipse plugin, known problem?

> Wow, thanks. It now fails differently, which is progress.

:-)

> It's failing to find nested static types (50 times), at least some of them.
>
> Any clues for that one?

Sorry, no, I'll have to pass on this one. I have a dual scala/java
project that is working fine, though it is mostly scala with some
token java.

- Stephen

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