Suppose I have some library lib.jar for which I do not have the source code (or it is written in some non-Java language which is unaware of modules yet).
lib.jar
Alternatively, to compile the module-info.java generated you need to also extract the contents of the JAR to a directory.
module-info.java
Then compile the module-info.java with the output directory (-d) set to the directory where you extracted the contents.
Credits :- Alan