Understanding module path arguments
Our example application is comprised of two Java modules. We have the source of both those modules in the module source path. In reality, it's common to be working on module sources that depend on compiled third-party modules pulled in as dependencies. In such cases, you'll need to provide to the compiler the module source path containing the module source files, and the module path for the compiled dependencies. The compiler needs a distinction between the code it needs to compile (in --module-source-path
) and the location of compiled dependencies and libraries ( --module-path
). When it comes to execution, you just pass in --module-path
pointing to the compiled modules.
Here are the command line argument values passed to the compiler and runtime:
| | |
| Locations of all source modules | Locations of compiled modules that the source modules depend on. |
| <Not provided> | Location of all compiled modules - including app... |