scalac doesn't see library that javac sees in another module?
Inside a larger Java project that consists of several modules, I wanted to create a new module (module S) in which I use Scala. Compiling scala files that don't depend on the other modules works well. But once I use a class from one of the existing Java modules (call it module J), it seems that scalac is scanning (or compiling?) the Java files inside the other modules. The problem now is, that the files in J depend on an external library. This library is listed as dependency for the module J.
Somehow scalac can't manage to use the dependencies of J. It works though, when I export these dependencies (using the checkbox on the dependencies page of module J).
What bugs me is the following:
I don't have to export the dependencies when I'm using classes from module J within other Java modules. But using it within a Scala file in module S, I do.
Can you please comment on this? I don't think that this behaviour is correct.
Please sign in to leave a comment.
If scalac shouldn't compile Java files then you need just to uncheck setting to compile scala files first in scala compiler settings page. May be this is what you want?
Best regards,
Alexander Podkhalyuzin.
Both having "compile java files first" set and unset produce the mentioned error when compiling.
This is the produced error:
Error:Error:line (3)error: value martiansoftware is not a member of package com
import com.martiansoftware.jsap.*;
This error happens inside a Java file of the refered module (J). It's an import that is satisfied by the dependencies of module J. Note that this happens when compiling module S.