module path
The list of directories and jars where the compiler and the launcher look for modules.
In more detail
javac and java take --module-path, or -p, as they take -cp for the class path. A modular jar on the module path is a named module; a plain jar there becomes an automatic module. java -p mods -m module/class runs a module's main class.
Example
java -p out -m com.shop.app/com.shop.app.MainRelated terms
- module — A named set of packages with a descriptor, module-info.java, that declares what it requires, exports, opens, uses and provides.
- class path — The list of folders and JAR files the JVM and the compiler search to find classes.
Taught in
- Modules: Exports, Opens And Services — Oracle Certified Professional: Java SE 21 Developer (1Z0-830) Exam Prep
- Jars, Automatic Modules And Runtime Images — Oracle Certified Professional: Java SE 21 Developer (1Z0-830) Exam Prep