unnamed module
The module that holds every class loaded from the class path.
In more detail
The unnamed module reads every other module and exports all its packages, but no named module can require it. Code on the class path therefore cannot be used by a named module except through an automatic module. Class.getModule().isNamed() is false for it.
Example
Main.class.getModule().isNamed() // false on the class pathRelated terms
- module — A named set of packages with a descriptor, module-info.java, that declares what it requires, exports, opens, uses and provides.
- automatic module — A plain jar placed on the module path, given a module name derived from its manifest or file name.
- 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