I have created a multimodule project with the following structure
myproject
|- mymodule
|- src
|- main
|- java
|- com
|- mymodule
|- Util.java
|-newmodule
|-src
|-main
|-java
|-com
|-newmodule
|- Main.java
|-module-info.java
Now i want to use Util.java which is a non modularized code in a modularized module newmodule. i have declared following in newmodule
module newmodule {
requires mymodule;
}
Project is compiling fine, but Intellij is showing module not found and package com.mymodule is declared in unnamed module , module 'newmodule' does not read it.
How to resolve this issue?
And one more question does all the old non modular code is by default turn into automatic-module in java 9 if i don't even modularized legacy modules?