Dependent modules must have equal Scala SDK versions

Hi!

I have multi-module java project in two of which contains also scala code. When I try to build the project I get an error as in the subject. If I move the scala code to its own module everything works, but is awkward to work with.

I hadn't been able to figure out what that error actually means, as I've tried adding the scala facet to every module.

Any ideas?

O.

5 comments
Comment actions Permalink

You should to add not only Scala Facet to module. Also you should add scala-compiler.jar and scala-library.jar to dependency, and seems that versions of them should be equal. Also it should be equal pathes in facet page.
Message text means that you have cyclic module dependencies, so for them should be used same compiler (because all of them should be compiled simultaneously).

I hope it helps.

Best regards,
Alexander Podkhalyuzin.

0
Comment actions Permalink

0.3.312 in release cannot compile multimodule project with the same scala version. Paths are same. Nor including scala as a global library neither with specific paths for every facet does not work reporting different scala version. In the beta everything was fine.

0
Comment actions Permalink

Alexander,

Can you clarify for me the proper use of the Scala facet?

Upon importing my Scala project (one module, Scala sources only) from its IDEA 8.1 form, I see some changes in the per-module Scala facet. Specifically, there is a check box labelled "Use Scala compiler libraries from specified jars" (not currently checked) and two text fields, "Scala compiler library" and "Scala SDK library" both greyed out and filled with JAR files from .../.IntelliJ90/config/plugins/Scala/lib/...

How is this facet pane to be used?

I'm using Scala 2.7, which I cofigure as a global library that is added as dependency for the project's module.


Randall Schulz

0
Comment actions Permalink

Facet page defines compiler. So as library you don't need scala-compiler.jar.
If you don't check "Use Scala compiler libraries from specified jars" then you'll define default compiler bundled with plugin (some nightly for scala 2.8). So if you want to use another compiler, you can check this checkbox and redefine compiler jars.

Best regards,
Alexander Podkhalyuzin.

0
Comment actions Permalink

The problem is discovered. If there are 2 modules in cyclic dependency one with scala facet and another one that is pure java, ScalacBackendCompiler tries to check the version of scala in both and naturally fails to do it. Patch supplied.



Attachment(s):
cyclic.diff.zip
0

Please sign in to leave a comment.