- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
Eclipse Galileo (3.5) + Scala 2.7.5 final + Java calling Scala
Tue, 2009-06-30, 09:39
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.
Tue, 2009-06-30, 10:17
#2
Re: Eclipse Galileo (3.5) + Scala 2.7.5 final + Java calling S
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
Tue, 2009-06-30, 10:27
#3
Re: Eclipse Galileo (3.5) + Scala 2.7.5 final + Java calling S
On Tue, Jun 30, 2009 at 10:14 AM, LML 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
On Tue, Jun 30, 2009 at 9:38 AM, LML 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