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

Eclipse plugin question

1 reply
Olli Aalto
Joined: 2009-08-11,
User offline. Last seen 42 years 45 weeks ago.

Hi!

I've been trying to use scala in our internal java-project, but I've run
into problems with the eclipse plugin. First with the current release of
the plugin I couldn't use scala classes from java at all. Seems like the
JDT didn't notice the scala's classes. I installed todays nightly build
and got that part working, but now I cannot call any methods from the
scala class.

The class is very simple as I'm testing this stuff still. I've even
looked at the .class file with javap and everything seems to be in order.

Is there anything I can do? What about the other IDEs, do these things
work in them?

O.

milessabin
Joined: 2008-08-11,
User offline. Last seen 33 weeks 3 days ago.
Re: Eclipse plugin question

On Tue, Aug 11, 2009 at 12:49 PM, Olli Aalto wrote:
> I've been trying to use scala in our internal java-project, but I've run
> into problems with the eclipse plugin. First with the current release of the
> plugin I couldn't use scala classes from java at all. Seems like the JDT
> didn't notice the scala's classes.

Actually, I think you'll find that the JDT has successfully compiled
your Java sources against your Scala sources. Unfortunately if you're
using Eclipse 3.5 (rather than 3.4.2) there's a bug which means that
the Java editor will in some circumstances report errors where Scala
entities are referenced. This is (about to be, as soon as I commit)
fixed on trunk. In the meantime, if you're able to work with Eclipse
3.4.2 you should find that most Scala constructs are unproblematic
when viewed from Java.

> I installed todays nightly build and got that part working, but now I
> cannot call any methods from the scala class.

Again, I suspect that actually you can: it's the Java editor reporting
a non-existent error ... the JDT's Java compiler on the other hand
will be compiling the code correctly and you should be able to execute
it.

Cheers,

Miles

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