[scala-tools] Eclipse Galileo (3.5) + Scala 2.7.5 final + Java calling Scala

View: New views
4 Messages — Rating Filter:   Alert me  

[scala-tools] Eclipse Galileo (3.5) + Scala 2.7.5 final + Java calling Scala

by LML-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I'm trying to call Scala code from Java.
Everything is build nicely by Eclipse
and runs -- so far so good.

Problem:
   open Java file,
   Eclipse Java Compiler does its magic -- just in time incremental analysis
   and says: The import my-scala-class cannot be resolved.
   which results in many `compiler Errors' for all Scala things
   refered to from the Java code...

In Ganymede (3.4) creating a .jar with all Scala classes and
using that as a referenced library helped.
In Galileo (3.5) it does not work any more :-(

The Scala project is of course a required project on the build path
of the Java project (that's why a full build works).

Any suggestions (beside not using Galileo yet)?
Thanks
   Lothar


P.S.: it's all done on a Mac, OSX 10.5.7 with latest Java 1.6.

Re: [scala-tools] Eclipse Galileo (3.5) + Scala 2.7.5 final + Java calling Scala

by Miles Sabin :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, Jun 30, 2009 at 9:38 AM, LML<TeXSatz@...> wrote:
> In Ganymede (3.4) creating a .jar with all Scala classes and
> using that as a referenced library helped.
> In Galileo (3.5) it does not work any more :-(

Is this a plain Java project referencing a .jar file containing scalac
generated .class files? That should just work in every version of
Eclipse. Some more details would help ...

Cheers,


Miles

--
Miles Sabin
tel: +44 (0)7813 944 528
skype:  milessabin
http://www.chuusai.com/
http://twitter.com/milessabin

Re: [scala-tools] Eclipse Galileo (3.5) + Scala 2.7.5 final + Java calling Scala

by LML-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I would like to use just the .class files generated from the Scala
project. But these are not seen (?) by the Java just in time compiler...

The generated .jar from the scalac generated .class files
does work -- I did not move the Scala .jar above the Scala project
in the build path (Order and Export)... --> Problem solved.
So everything is well in Eclipse 3.4 and 3.5 (with a .jar,
it's just too complicated).

Thanks
   Lothar

Re: [scala-tools] Eclipse Galileo (3.5) + Scala 2.7.5 final + Java calling Scala

by Miles Sabin :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, Jun 30, 2009 at 10:14 AM, LML<TeXSatz@...> wrote:
> I would like to use just the .class files generated from the Scala project.
> But these are not seen (?) by the Java just in time compiler...

OK, can you show me the .classpath and .project files from both the
Java and the Scala projects?

While we're at it: can you confirm that your Scala project's output
directory does actually contain all the .class files you're expecting?

Cheers,


Miles

--
Miles Sabin
tel: +44 (0)7813 944 528
skype:  milessabin
http://www.chuusai.com/
http://twitter.com/milessabin