setLocationForModule doesn't work as expected

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

setLocationForModule doesn't work as expected

Oliver Siegmar
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

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: setLocationForModule doesn't work as expected

Jonathan Gibbons
Oliver,

It seems like you're doing something reasonable. We'll have to
investigate and get back to you.

-- Jon


On 8/9/17 7: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
>

Loading...