setLocationForModule doesn't work as expected
Jonathan Gibbons
jonathan.gibbons at oracle.com
Fri Oct 6 23:57:22 UTC 2017
Oliver,
This looks like:
JDK-8188035: JavaFileManager.listLocationsForModules does not always
reflect values set through tandardJavaFileManager.setLocationForModule.
https://bugs.openjdk.java.net/browse/JDK-8188035
-- Jon
On 08/09/2017 07:18 AM, Oliver Siegmar wrote:
> Hello Jigsaw-experts,
>
> I’m currently struggling with the javax.tools.StandardJavaFileManager#setLocationForModule method and wondering if someone could point me in the right direction.
>
> I thought, the setLocationForModule method can be used for referencing a dependent module to compile another one.
>
> In an example, I have two modules - api and app. The api module compiles fine. When I try to compile the app module, I’m using this to set the path of the compiled api module:
>
> fileManager.setLocationForModule(StandardLocation.MODULE_PATH, NAME_OF_THE_API_MODULE, List.of(PATH_OF_THE_COMPILED_API_MODULE));
>
> Unfortunately the compiler can’t find that dependent module ("error: module not found“ when trying to compile module-info.java).
>
> Also, I’ve noticed, that it perfectly works, if I use StandardLocation.SYSTEM_MODULES instead of StandardLocation.MODULE_PATH.
>
> I’ve created a quick demo at https://github.com/osiegmar/java9-module-path-compile-problem <https://github.com/osiegmar/java9-module-path-compile-problem>
>
>
> Is it my fault or is it a compiler bug?
>
>
> Bye
>
> Oliver
>
More information about the jigsaw-dev
mailing list